/administrator/components/com_weblinks/views/weblinks/tmpl/default.php
PHP | 189 lines | 177 code | 5 blank | 7 comment | 23 complexity | 5876fdb881b583828b9466a6e5c2ee02 MD5 | raw file
Possible License(s): LGPL-2.1
1<?php 2/** 3 * @package Joomla.Administrator 4 * @subpackage com_weblinks 5 * 6 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 7 * @license GNU General Public License version 2 or later; see LICENSE.txt 8 */ 9 10defined('_JEXEC') or die; 11 12JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); 13JHtml::_('behavior.tooltip'); 14JHtml::_('behavior.multiselect'); 15 16$user = JFactory::getUser(); 17$userId = $user->get('id'); 18$listOrder = $this->escape($this->state->get('list.ordering')); 19$listDirn = $this->escape($this->state->get('list.direction')); 20$canOrder = $user->authorise('core.edit.state', 'com_weblinks.category'); 21$saveOrder = $listOrder == 'a.ordering'; 22if ($saveOrder) 23{ 24 $saveOrderingUrl = 'index.php?option=com_weblinks&task=weblinks.saveOrderAjax&tmpl=component'; 25 JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); 26} 27$sortFields = $this->getSortFields(); 28?> 29<script type="text/javascript"> 30 Joomla.orderTable = function() { 31 table = document.getElementById("sortTable"); 32 direction = document.getElementById("directionTable"); 33 order = table.options[table.selectedIndex].value; 34 if (order != '<?php echo $listOrder; ?>') { 35 dirn = 'asc'; 36 } else { 37 dirn = direction.options[direction.selectedIndex].value; 38 } 39 Joomla.tableOrdering(order, dirn, ''); 40 } 41</script> 42<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm"> 43 <div id="filter-bar" class="btn-toolbar"> 44 <div class="filter-search btn-group pull-left"> 45 <label for="filter_search" class="element-invisible"><?php echo JText::_('COM_WEBLINKS_SEARCH_IN_TITLE');?></label> 46 <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('COM_WEBLINKS_SEARCH_IN_TITLE'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_WEBLINKS_SEARCH_IN_TITLE'); ?>" /> 47 </div> 48 <div class="btn-group pull-left"> 49 <button class="btn" rel="tooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button> 50 <button class="btn" rel="tooltip" type="button" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button> 51 </div> 52 <div class="btn-group pull-right hidden-phone"> 53 <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label> 54 <?php echo $this->pagination->getLimitBox(); ?> 55 </div> 56 <div class="btn-group pull-right hidden-phone"> 57 <label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label> 58 <select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()"> 59 <option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option> 60 <option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option> 61 <option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option> 62 </select> 63 </div> 64 <div class="btn-group pull-right"> 65 <label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label> 66 <select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()"> 67 <option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option> 68 <?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?> 69 </select> 70 </div> 71 </div> 72 <div class="clearfix"> </div> 73 <table class="table table-striped" id="weblinkList"> 74 <thead> 75 <tr> 76 <th width="1%" class="nowrap center hidden-phone"> 77 <?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> 78 </th> 79 <th width="1%" class="hidden-phone"> 80 <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> 81 </th> 82 <th width="1%" class="nowrap center"> 83 <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?> 84 </th> 85 <th class="title"> 86 <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> 87 </th> 88 <th width="5%" class="nowrap hidden-phone"> 89 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?> 90 </th> 91 <th width="5%" class="nowrap center hidden-phone"> 92 <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?> 93 </th> 94 <th width="5%" class="nowrap hidden-phone"> 95 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?> 96 </th> 97 <th width="1%" class="nowrap center hidden-phone"> 98 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 99 </th> 100 </tr> 101 </thead> 102 <tfoot> 103 <tr> 104 <td colspan="10"> 105 <?php echo $this->pagination->getListFooter(); ?> 106 </td> 107 </tr> 108 </tfoot> 109 <tbody> 110 <?php foreach ($this->items as $i => $item) : 111 $ordering = ($listOrder == 'a.ordering'); 112 $item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_weblinks&task=edit&type=other&cid[]='. $item->catid); 113 $canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $item->catid); 114 $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $item->catid); 115 $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0; 116 $canChange = $user->authorise('core.edit.state', 'com_weblinks.category.' . $item->catid) && $canCheckin; 117 ?> 118 <tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->catid?>"> 119 <td class="order nowrap center hidden-phone"> 120 <?php if ($canChange) : 121 $disableClassName = ''; 122 $disabledLabel = ''; 123 if (!$saveOrder) : 124 $disabledLabel = JText::_('JORDERINGDISABLED'); 125 $disableClassName = 'inactive tip-top'; 126 endif; ?> 127 <span class="sortable-handler <?php echo $disableClassName?>" title="<?php echo $disabledLabel?>" rel="tooltip"> 128 <i class="icon-menu"></i> 129 </span> 130 <input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering;?>" class="width-20 text-area-order " /> 131 <?php else : ?> 132 <span class="sortable-handler inactive" > 133 <i class="icon-menu"></i> 134 </span> 135 <?php endif; ?> 136 </td> 137 <td class="center hidden-phone"> 138 <?php echo JHtml::_('grid.id', $i, $item->id); ?> 139 </td> 140 <td class="center hidden-phone"> 141 <?php echo JHtml::_('jgrid.published', $item->state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> 142 </td> 143 <td class="nowrap"> 144 <?php if ($item->checked_out) : ?> 145 <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?> 146 <?php endif; ?> 147 <?php if ($canEdit) : ?> 148 <a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id='.(int) $item->id); ?>"> 149 <?php echo $this->escape($item->title); ?></a> 150 <?php else : ?> 151 <?php echo $this->escape($item->title); ?> 152 <?php endif; ?> 153 <span class="small"> 154 <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?> 155 </span> 156 <div class="small"> 157 <?php echo $this->escape($item->category_title); ?> 158 </div> 159 </td> 160 <td class="small hidden-phone"> 161 <?php echo $this->escape($item->access_level); ?> 162 </td> 163 <td class="center hidden-phone"> 164 <?php echo $item->hits; ?> 165 </td> 166 <td class="small nowrap hidden-phone"> 167 <?php if ($item->language == '*'):?> 168 <?php echo JText::alt('JALL', 'language'); ?> 169 <?php else:?> 170 <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> 171 <?php endif;?> 172 </td> 173 <td class="center hidden-phone"> 174 <?php echo (int) $item->id; ?> 175 </td> 176 </tr> 177 <?php endforeach; ?> 178 </tbody> 179 </table> 180 181 <?php //Load the batch processing form. ?> 182 <?php echo $this->loadTemplate('batch'); ?> 183 184 <input type="hidden" name="task" value="" /> 185 <input type="hidden" name="boxchecked" value="0" /> 186 <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> 187 <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> 188 <?php echo JHtml::_('form.token'); ?> 189</form>