PageRenderTime 35ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_jfusion/views/plugindisplay2/tmpl/default.php

http://jfusion.googlecode.com/
PHP | 250 lines | 207 code | 25 blank | 18 comment | 23 complexity | 0fec4ac43d24140e2b5a3d139a8c49c7 MD5 | raw file
Possible License(s): Apache-2.0
  1. <?php
  2. /**
  3. * @package JFusion
  4. * @subpackage Views
  5. * @author JFusion development team
  6. * @copyright Copyright (C) 2008 JFusion. All rights reserved.
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  8. */
  9. // no direct access
  10. defined('_JEXEC') or die('Restricted access');
  11. JHTML::_('behavior.modal', 'a.modal');
  12. $images = 'components/com_jfusion/images/';
  13. ?>
  14. <script type="text/javascript">
  15. var mySortableTable;
  16. var dragHandles = document.getElementsByName('handle');
  17. window.addEvent('domready',function(){
  18. var url = '<?php echo JURI::root() . 'administrator/index.php'; ?>';
  19. var ajaxsync = new Ajax(url, {
  20. method: 'get'
  21. });
  22. mySortableTable = new Sortables('sort_table',{
  23. /* set options */
  24. handles: dragHandles,
  25. /* initialization stuff here */
  26. initialize: function() {
  27. },
  28. /* once an item is selected */
  29. onStart: function(el) {
  30. //a little fancy work to hide the clone which mootools 1.1 doesn't seem to give the option for
  31. var checkme = $$('div tr#' + el.id);
  32. if (checkme[1]) {
  33. checkme[1].setStyle('display','none');
  34. }
  35. },
  36. onComplete: function(el) {
  37. //build a string of the order
  38. var sort_order = '';
  39. var rowcount = '0';
  40. $$('#sort_table tr').each(function(tr) {
  41. document.getElementById(tr.id).setAttribute('class', 'row' + rowcount);
  42. if (rowcount == '0') {
  43. rowcount = '1';
  44. } else {
  45. rowcount = '0';
  46. }
  47. sort_order = sort_order + tr.id + '|';
  48. });
  49. //update the database
  50. sync_vars = 'option=com_jfusion&task=saveorder&tmpl=component&sort_order='+sort_order;
  51. ajaxsync.request(sync_vars);
  52. //alert(sort_order);
  53. }
  54. });
  55. });
  56. </script>
  57. <form method="post" action="index2.php" name="adminForm">
  58. <input type="hidden" name="option" value="com_jfusion" />
  59. <input type="hidden" name="task" value="saveorder" />
  60. <table class="adminlist" style="border-spacing:1px;">
  61. <thead>
  62. <tr>
  63. <th class="title" width="20px;"></th>
  64. <th class="title" align="left"><?php echo JText::_('NAME');?></th>
  65. <th class="title" width="75px" align="center"><?php echo JText::_('ACTIONS');?></th>
  66. <th class="title" align="center"><?php echo JText::_('DESCRIPTION');?></th>
  67. <th class="title" width="40px" align="center"><?php echo JText::_('ACTIVE');?></th>
  68. <th class="title" width="40px" align="center"><?php echo JText::_('DUAL_LOGIN');?></th>
  69. <th class="title" align="center"><?php echo JText::_('STATUS');?></th>
  70. <th class="title" align="center"><?php echo JText::_('USERS');?></th>
  71. <th class="title" align="center"><?php echo JText::_('REGISTRATION');?></th>
  72. <th class="title" align="center"><?php echo JText::_('USERGROUPS');?></th>
  73. </tr>
  74. </thead>
  75. <tbody id="sort_table">
  76. <?php
  77. //initialise some variables
  78. $row_count = 0;
  79. $array_start = 1;
  80. $array_end = end($this->plugins);
  81. //loop through the JFusion plugins
  82. foreach($this->plugins as $record) :
  83. ?>
  84. <tr id="<?php echo $record->name; ?>" class="row<? echo $row_count; ?>">
  85. <td width="20px;"><img src="<?php echo $images?>draggable.png" name="handle"></td>
  86. <td><?php echo $record->name ?></td>
  87. <td width="75px;">
  88. <?php if ($record->name == 'joomla_int'): //joomla_int must be treated separately?>
  89. <a href="index.php?option=com_jfusion&task=plugineditor&jname=<?php echo $record->name; ?>" title="Edit Plugin"><img src="<?php echo $images ?>edit.png" alt="Edit Plugin" /></a>
  90. <img src="<?php echo $images ?>copy_icon_dim.png" />
  91. <img src="<?php echo $images ?>delete_icon_dim.png" />
  92. <img src="<?php echo $images ?>wizard_icon_dim.png" />
  93. <?php elseif (!empty($record->copies)): //cannot delete copies?>
  94. <a href="index.php?option=com_jfusion&task=plugineditor&jname=<?php echo $record->name; ?>" title="Edit Plugin"><img src="<?php echo $images ?>edit.png" alt="Edit Plugin" /></a>
  95. <a href="javascript: void(0)" onclick="copy_plugin('index.php?option=com_jfusion&task=copy_plugin&jname=<?php echo $record->name; ?>')" title="Copy Plugin"><img src="<?php echo $images ?>copy_icon.png" alt="Copy Plugin" /></a>
  96. <img src="<?php echo $images ?>delete_icon_dim.png" title='<?php echo JText::_('PLUGIN_HAS_COPIES'); ?>' />
  97. <?php if ($record->wizard): ?>
  98. <a href="index.php?option=com_jfusion&task=wizard&jname=<?php echo $record->name; ?>" title="Plugin Wizard"><img src="<?php echo $images ?>wizard_icon.png" alt="Plugin Wizard" /></a>
  99. <?php else :?>
  100. <img src="<?php echo $images ?>wizard_icon_dim.png" />
  101. <?php endif; ?>
  102. <?php else: //all others?>
  103. <a href="index.php?option=com_jfusion&task=plugineditor&jname=<?php echo $record->name; ?>" title="Edit Plugin"><img src="<?php echo $images ?>edit.png" alt="Edit Plugin" /></a>
  104. <a href="javascript: void(0)" onclick="copy_plugin('index.php?option=com_jfusion&task=copy_plugin&jname=<?php echo $record->name; ?>')" title="Copy Plugin"><img src="<?php echo $images ?>copy_icon.png" alt="Copy Plugin" /></a>
  105. <a href="javascript: void(0)" onclick="uninstall_plugin('<?php echo $record->name; ?>')" title="Delete Plugin"><img src="<?php echo $images ?>delete_icon.png" alt="Uninstall Plugin" /></a>
  106. <?php if ($record->wizard): ?>
  107. <a href="index.php?option=com_jfusion&task=wizard&jname=<?php echo $record->name; ?>" title="Plugin Wizard"><img src="<?php echo $images ?>wizard_icon.png" alt="Plugin Wizard" /></a>
  108. <?php else :?>
  109. <img src="<?php echo $images ?>wizard_icon_dim.png" />
  110. <?php endif; ?>
  111. <?php endif; ?>
  112. </td>
  113. <td><?php echo $record->description;?></td>
  114. <?php if ($record->name == 'joomla_int'): //joomla is always active if configured correctly ?>
  115. <td width="40px;"><img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /></td>
  116. <td width="40px;"><img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /></td>
  117. <?php else: //if plugin not configured hide enabling options ?>
  118. <?php if ($record->status !='1'): ?>
  119. <td width="40px;"><img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Disabled" /></td>
  120. <td width="40px;"><img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Disabled" /></td>
  121. <?php else: //output the actual field results ?>
  122. <td width="40px;">
  123. <?php if ($record->active =='1'): ?>
  124. <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=active&field_value=0" title="Disable Plugin">
  125. <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" />
  126. </a>
  127. <?php else: ?>
  128. <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=active&field_value=1" title="Enable Plugin">
  129. <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" />
  130. </a>
  131. <?php endif; ?>
  132. </td>
  133. <td width="40px;">
  134. <?php if ($record->dual_login =='1'): ?>
  135. <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=dual_login&field_value=0" title="Disable Plugin">
  136. <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" />
  137. </a>
  138. <?php else: ?>
  139. <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=dual_login&field_value=1" title="Enable Plugin">
  140. <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" />
  141. </a>
  142. <?php endif; ?>
  143. </td>
  144. <?php endif; ?>
  145. <?php endif; ?>
  146. <?php if ($record->status=='1'):?>
  147. <td><img src="<?php echo $images; ?>tick.png" border="0" alt="Good Config" /><?php echo JText::_('GOOD_CONFIG'); ?></td>
  148. <td><?php echo $record->users;?></td>
  149. <td>
  150. <?php if (!empty($record->registration)): ?>
  151. <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /><?php echo JText::_('ENABLED'); ?>
  152. <?php else: ?>
  153. <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" /><?php echo JText::_('DISABLED'); ?>
  154. <?php endif; ?>
  155. </td>
  156. <?php else: ?>
  157. <td><img src="<?php echo $images; ?>cross.png" border="0" alt="Wrong Config" /><?php echo JText::_('NO_CONFIG'); ?></td>
  158. <?php if($record->name=='joomla_int'): ?>
  159. <td><?php echo $record->users;?></td>
  160. <td>
  161. <?php if (!empty($record->registration)): ?>
  162. <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /><?php echo JText::_('ENABLED'); ?>
  163. <?php else: ?>
  164. <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" /><?php echo JText::_('DISABLED'); ?>
  165. <?php endif; ?>
  166. <?php else: ?>
  167. <td></td>
  168. <td></td>
  169. <?php endif; ?>
  170. <?php endif; ?>
  171. <td>
  172. <?php if($record->usergroups): ?>
  173. <img src="<?php echo $images; ?>tick.png" border="0" alt="" /><?php echo JText::_('CONFIGURED'); ?>
  174. <?php else: ?>
  175. <img src="<?php echo $images; ?>cross.png" border="0" alt="" /><?php echo JText::_('NO_CONFIG'); ?>
  176. <?php endif; ?>
  177. </tr>
  178. <?php
  179. if ($row_count == 1):
  180. $row_count = 0;
  181. else:
  182. $row_count = 1;
  183. endif;
  184. endforeach;
  185. ?>
  186. </tbody>
  187. </table>
  188. <br />
  189. <table style="width:100%;">
  190. <tr>
  191. <td style="text-align: left;">
  192. <img src="<?php echo $images; ?>edit.png" border="0" alt="Edit" /> = <?php echo JText::_('EDIT');?>
  193. <img src="<?php echo $images; ?>copy_icon.png" border="0" alt="Copy" style="margin-left: 10px;" /> = <?php echo JText::_('COPY');?>
  194. <img src="<?php echo $images; ?>delete_icon.png" border="0" alt="Delete" style="margin-left: 10px;" /> = <?php echo JText::_('DELETE');?>
  195. <img src="<?php echo $images; ?>wizard_icon.png" border="0" alt="Wizard" style="margin-left: 10px;" /> = <?php echo JText::_('WIZARD');?>
  196. </td>
  197. <td style="text-align: right;">
  198. <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /> = <?php echo JText::_('ENABLED'); ?>
  199. <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" style="margin-left: 10px;" /> = <?php echo JText::_('DISABLED');?>
  200. <img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Config Plugin First" style="margin-left: 10px;" /> = <?php echo JText::_('CONFIG_FIRST');?>
  201. </td>
  202. </tr>
  203. </table>
  204. </form>
  205. <br />
  206. <?php
  207. if(!empty($this->VersionData)) :
  208. //display installer data
  209. $jfusion_plugins = $this->VersionData->plugins[0]->children();
  210. ?>
  211. <table class="adminform">
  212. <tr>
  213. <td width="50px"><img src="templates/khepri/images/header/icon-48-install.png" height="48px" width="48px"></td>
  214. <td><h1><font color=0b55c4><?php echo 'JFusion ' . JText::_('PLUGIN_INSTALL'); ?></font></h1></td>
  215. <td>
  216. <select id="plugin_name">
  217. <?php foreach ($jfusion_plugins as $plugin): ?>
  218. <option><?php echo $plugin->name(); ?></option>
  219. <?php endforeach; ?>
  220. </select>
  221. <input class="button" type="button" value="<?php echo JText::_( 'INSTALL' );?>" onclick="location.href = 'index.php?option=com_jfusion&mode=jfusion&task=install&redirect=plugindisplay&name=' + document.getElementById('plugin_name').value" />
  222. </td>
  223. </tr>
  224. </table>
  225. <?php endif; ?>