/administrator/components/com_jfusion/views/plugindisplay2/tmpl/default.php
PHP | 250 lines | 207 code | 25 blank | 18 comment | 23 complexity | 0fec4ac43d24140e2b5a3d139a8c49c7 MD5 | raw file
Possible License(s): Apache-2.0
- <?php
- /**
- * @package JFusion
- * @subpackage Views
- * @author JFusion development team
- * @copyright Copyright (C) 2008 JFusion. All rights reserved.
- * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- */
-
- // no direct access
- defined('_JEXEC') or die('Restricted access');
- JHTML::_('behavior.modal', 'a.modal');
-
- $images = 'components/com_jfusion/images/';
- ?>
- <script type="text/javascript">
- var mySortableTable;
- var dragHandles = document.getElementsByName('handle');
- window.addEvent('domready',function(){
- var url = '<?php echo JURI::root() . 'administrator/index.php'; ?>';
- var ajaxsync = new Ajax(url, {
- method: 'get'
- });
-
- mySortableTable = new Sortables('sort_table',{
- /* set options */
- handles: dragHandles,
- /* initialization stuff here */
- initialize: function() {
-
- },
- /* once an item is selected */
- onStart: function(el) {
- //a little fancy work to hide the clone which mootools 1.1 doesn't seem to give the option for
- var checkme = $$('div tr#' + el.id);
- if (checkme[1]) {
- checkme[1].setStyle('display','none');
- }
- },
-
- onComplete: function(el) {
- //build a string of the order
- var sort_order = '';
- var rowcount = '0';
- $$('#sort_table tr').each(function(tr) {
- document.getElementById(tr.id).setAttribute('class', 'row' + rowcount);
- if (rowcount == '0') {
- rowcount = '1';
- } else {
- rowcount = '0';
- }
- sort_order = sort_order + tr.id + '|';
- });
-
- //update the database
- sync_vars = 'option=com_jfusion&task=saveorder&tmpl=component&sort_order='+sort_order;
- ajaxsync.request(sync_vars);
-
- //alert(sort_order);
- }
-
- });
- });
- </script>
-
- <form method="post" action="index2.php" name="adminForm">
- <input type="hidden" name="option" value="com_jfusion" />
- <input type="hidden" name="task" value="saveorder" />
-
- <table class="adminlist" style="border-spacing:1px;">
- <thead>
- <tr>
- <th class="title" width="20px;"></th>
- <th class="title" align="left"><?php echo JText::_('NAME');?></th>
- <th class="title" width="75px" align="center"><?php echo JText::_('ACTIONS');?></th>
- <th class="title" align="center"><?php echo JText::_('DESCRIPTION');?></th>
- <th class="title" width="40px" align="center"><?php echo JText::_('ACTIVE');?></th>
- <th class="title" width="40px" align="center"><?php echo JText::_('DUAL_LOGIN');?></th>
- <th class="title" align="center"><?php echo JText::_('STATUS');?></th>
- <th class="title" align="center"><?php echo JText::_('USERS');?></th>
- <th class="title" align="center"><?php echo JText::_('REGISTRATION');?></th>
- <th class="title" align="center"><?php echo JText::_('USERGROUPS');?></th>
- </tr>
- </thead>
- <tbody id="sort_table">
-
- <?php
- //initialise some variables
- $row_count = 0;
- $array_start = 1;
- $array_end = end($this->plugins);
-
- //loop through the JFusion plugins
- foreach($this->plugins as $record) :
- ?>
- <tr id="<?php echo $record->name; ?>" class="row<? echo $row_count; ?>">
- <td width="20px;"><img src="<?php echo $images?>draggable.png" name="handle"></td>
- <td><?php echo $record->name ?></td>
-
- <td width="75px;">
- <?php if ($record->name == 'joomla_int'): //joomla_int must be treated separately?>
- <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>
- <img src="<?php echo $images ?>copy_icon_dim.png" />
- <img src="<?php echo $images ?>delete_icon_dim.png" />
- <img src="<?php echo $images ?>wizard_icon_dim.png" />
- <?php elseif (!empty($record->copies)): //cannot delete copies?>
- <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>
- <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>
- <img src="<?php echo $images ?>delete_icon_dim.png" title='<?php echo JText::_('PLUGIN_HAS_COPIES'); ?>' />
- <?php if ($record->wizard): ?>
- <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>
- <?php else :?>
- <img src="<?php echo $images ?>wizard_icon_dim.png" />
- <?php endif; ?>
- <?php else: //all others?>
- <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>
- <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>
- <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>
- <?php if ($record->wizard): ?>
- <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>
- <?php else :?>
- <img src="<?php echo $images ?>wizard_icon_dim.png" />
- <?php endif; ?>
- <?php endif; ?>
- </td>
-
- <td><?php echo $record->description;?></td>
-
-
- <?php if ($record->name == 'joomla_int'): //joomla is always active if configured correctly ?>
- <td width="40px;"><img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /></td>
- <td width="40px;"><img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /></td>
- <?php else: //if plugin not configured hide enabling options ?>
- <?php if ($record->status !='1'): ?>
- <td width="40px;"><img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Disabled" /></td>
- <td width="40px;"><img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Disabled" /></td>
- <?php else: //output the actual field results ?>
- <td width="40px;">
- <?php if ($record->active =='1'): ?>
- <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=active&field_value=0" title="Disable Plugin">
- <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" />
- </a>
- <?php else: ?>
- <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=active&field_value=1" title="Enable Plugin">
- <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" />
- </a>
- <?php endif; ?>
- </td>
- <td width="40px;">
- <?php if ($record->dual_login =='1'): ?>
- <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=dual_login&field_value=0" title="Disable Plugin">
- <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" />
- </a>
- <?php else: ?>
- <a href="index.php?option=com_jfusion&task=changesetting&jname=<?php echo $record->name; ?>&field_name=dual_login&field_value=1" title="Enable Plugin">
- <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" />
- </a>
- <?php endif; ?>
- </td>
- <?php endif; ?>
- <?php endif; ?>
-
- <?php if ($record->status=='1'):?>
- <td><img src="<?php echo $images; ?>tick.png" border="0" alt="Good Config" /><?php echo JText::_('GOOD_CONFIG'); ?></td>
- <td><?php echo $record->users;?></td>
- <td>
- <?php if (!empty($record->registration)): ?>
- <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /><?php echo JText::_('ENABLED'); ?>
- <?php else: ?>
- <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" /><?php echo JText::_('DISABLED'); ?>
- <?php endif; ?>
- </td>
- <?php else: ?>
- <td><img src="<?php echo $images; ?>cross.png" border="0" alt="Wrong Config" /><?php echo JText::_('NO_CONFIG'); ?></td>
- <?php if($record->name=='joomla_int'): ?>
- <td><?php echo $record->users;?></td>
- <td>
- <?php if (!empty($record->registration)): ?>
- <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /><?php echo JText::_('ENABLED'); ?>
- <?php else: ?>
- <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" /><?php echo JText::_('DISABLED'); ?>
- <?php endif; ?>
- <?php else: ?>
- <td></td>
- <td></td>
- <?php endif; ?>
- <?php endif; ?>
-
- <td>
- <?php if($record->usergroups): ?>
- <img src="<?php echo $images; ?>tick.png" border="0" alt="" /><?php echo JText::_('CONFIGURED'); ?>
- <?php else: ?>
- <img src="<?php echo $images; ?>cross.png" border="0" alt="" /><?php echo JText::_('NO_CONFIG'); ?>
- <?php endif; ?>
- </tr>
- <?php
-
- if ($row_count == 1):
- $row_count = 0;
- else:
- $row_count = 1;
- endif;
-
- endforeach;
-
- ?>
- </tbody>
- </table>
- <br />
-
- <table style="width:100%;">
- <tr>
- <td style="text-align: left;">
- <img src="<?php echo $images; ?>edit.png" border="0" alt="Edit" /> = <?php echo JText::_('EDIT');?>
- <img src="<?php echo $images; ?>copy_icon.png" border="0" alt="Copy" style="margin-left: 10px;" /> = <?php echo JText::_('COPY');?>
- <img src="<?php echo $images; ?>delete_icon.png" border="0" alt="Delete" style="margin-left: 10px;" /> = <?php echo JText::_('DELETE');?>
- <img src="<?php echo $images; ?>wizard_icon.png" border="0" alt="Wizard" style="margin-left: 10px;" /> = <?php echo JText::_('WIZARD');?>
- </td>
- <td style="text-align: right;">
- <img src="<?php echo $images; ?>tick.png" border="0" alt="Enabled" /> = <?php echo JText::_('ENABLED'); ?>
- <img src="<?php echo $images; ?>cross.png" border="0" alt="Disabled" style="margin-left: 10px;" /> = <?php echo JText::_('DISABLED');?>
- <img src="<?php echo $images; ?>cross_dim.png" border="0" alt="Config Plugin First" style="margin-left: 10px;" /> = <?php echo JText::_('CONFIG_FIRST');?>
- </td>
- </tr>
- </table>
-
- </form>
- <br />
-
- <?php
- if(!empty($this->VersionData)) :
- //display installer data
- $jfusion_plugins = $this->VersionData->plugins[0]->children();
- ?>
-
- <table class="adminform">
- <tr>
- <td width="50px"><img src="templates/khepri/images/header/icon-48-install.png" height="48px" width="48px"></td>
- <td><h1><font color=0b55c4><?php echo 'JFusion ' . JText::_('PLUGIN_INSTALL'); ?></font></h1></td>
- <td>
- <select id="plugin_name">
- <?php foreach ($jfusion_plugins as $plugin): ?>
- <option><?php echo $plugin->name(); ?></option>
- <?php endforeach; ?>
- </select>
- <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" />
- </td>
- </tr>
- </table>
- <?php endif; ?>