PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/administrator/templates/hathor/html/com_menus/items/default.php

https://github.com/ianmacl/page_objects
PHP | 219 lines | 192 code | 15 blank | 12 comment | 24 complexity | f7de3ad8d99e6bff68e0d08baa6d8404 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: default.php 20196 2011-01-09 02:40:25Z ian $
  4. * @package Joomla.Administrator
  5. * @subpackage templates.hathor
  6. * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. * @since 1.6
  9. */
  10. // no direct access
  11. defined('_JEXEC') or die;
  12. // Include the component HTML helpers.
  13. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  14. JHtml::_('behavior.tooltip');
  15. $user = JFactory::getUser();
  16. $userId = $user->get('id');
  17. $listOrder = $this->state->get('list.ordering');
  18. $listDirn = $this->state->get('list.direction');
  19. $ordering = ($listOrder == 'a.lft');
  20. $canOrder = $user->authorise('core.edit.state', 'com_menus');
  21. $saveOrder = ($listOrder == 'a.lft' && $listDirn == 'asc');
  22. ?>
  23. <form action="<?php echo JRoute::_('index.php?option=com_menus&view=items');?>" method="post" name="adminForm" id="adminForm">
  24. <fieldset id="filter-bar">
  25. <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
  26. <div class="filter-search">
  27. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  28. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_MENUS_ITEMS_SEARCH_FILTER'); ?>" />
  29. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  30. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  31. </div>
  32. <div class="filter-select">
  33. <label class="selectlabel" for="menutype">
  34. <?php echo JText::_('TPL_HATHOR_COM_MENUS_MENU'); ?>
  35. </label>
  36. <select name="menutype" id="menutype" class="inputbox">
  37. <?php echo JHtml::_('select.options', JHtml::_('menu.menus'), 'value', 'text', $this->state->get('filter.menutype'));?>
  38. </select>
  39. <label class="selectlabel" for="filter_level">
  40. <?php echo JText::_('COM_MENUS_OPTION_SELECT_LEVEL'); ?>
  41. </label>
  42. <select name="filter_level" id="filter_level" class="inputbox">
  43. <option value=""><?php echo JText::_('COM_MENUS_OPTION_SELECT_LEVEL');?></option>
  44. <?php echo JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level'));?>
  45. </select>
  46. <label class="selectlabel" for="filter_published">
  47. <?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?>
  48. </label>
  49. <select name="filter_published" id="filter_published" class="inputbox">
  50. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  51. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true);?>
  52. </select>
  53. <label class="selectlabel" for="filter_access">
  54. <?php echo JText::_('JOPTION_SELECT_ACCESS'); ?>
  55. </label>
  56. <select name="filter_access" id="filter_access" class="inputbox">
  57. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  58. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
  59. </select>
  60. <label class="selectlabel" for="filter_language">
  61. <?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?>
  62. </label>
  63. <select name="filter_language" id="filter_language" class="inputbox">
  64. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  65. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  66. </select>
  67. <button type="button" id="filter-go" onclick="this.form.submit();">
  68. <?php echo JText::_('JSUBMIT'); ?></button>
  69. </div>
  70. </fieldset>
  71. <div class="clr"> </div>
  72. <table class="adminlist">
  73. <thead>
  74. <tr>
  75. <th class="checkmark-col">
  76. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('TPL_HATHOR_CHECKMARK_ALL'); ?>" onclick="checkAll(this)" />
  77. </th>
  78. <th class="title">
  79. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  80. </th>
  81. <th class="nowrap state-col">
  82. <?php echo JHtml::_('grid.sort', 'JPUBLISHED', 'a.published', $listDirn, $listOrder); ?>
  83. </th>
  84. <th class="nowrap ordering-col">
  85. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'a.lft', $listDirn, $listOrder); ?>
  86. <?php if ($canOrder && $saveOrder) :?>
  87. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'items.saveorder'); ?>
  88. <?php endif; ?>
  89. </th>
  90. <th class="title access-col">
  91. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
  92. </th>
  93. <th width="10%">
  94. <?php echo JText::_('JGRID_HEADING_MENU_ITEM_TYPE'); ?>
  95. </th>
  96. <th class="home-col">
  97. <?php echo JHtml::_('grid.sort', 'COM_MENUS_HEADING_HOME', 'a.home', $listDirn, $listOrder); ?>
  98. </th>
  99. <th class="language-col">
  100. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
  101. </th>
  102. <th class="nowrap id-col">
  103. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  104. </th>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <?php
  109. $originalOrders = array();
  110. foreach ($this->items as $i => $item) :
  111. // $lang = JFactory::getLanguage();
  112. // $lang->load($item->componentname, JPATH_ADMINISTRATOR);
  113. $orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
  114. $canCreate = $user->authorise('core.create', 'com_menus');
  115. $canEdit = $user->authorise('core.edit', 'com_menus');
  116. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id')|| $item->checked_out==0;
  117. $canChange = $user->authorise('core.edit.state', 'com_menus') && $canCheckin;
  118. ?>
  119. <tr class="row<?php echo $i % 2; ?>">
  120. <td class="center">
  121. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  122. </td>
  123. <td>
  124. <?php echo str_repeat('<span class="gi">|&mdash;</span>', $item->level-1) ?>
  125. <?php if ($item->checked_out) : ?>
  126. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'items.', $canCheckin); ?>
  127. <?php endif; ?>
  128. <?php if ($canEdit) : ?>
  129. <a href="<?php echo JRoute::_('index.php?option=com_menus&task=item.edit&id='.(int) $item->id);?>">
  130. <?php echo $this->escape($item->title); ?></a>
  131. <?php else : ?>
  132. <?php echo $this->escape($item->title); ?>
  133. <?php endif; ?>
  134. <p class="smallsub" title="<?php echo $this->escape($item->path);?>">
  135. <?php echo str_repeat('<span class="gtr">|&mdash;</span>', $item->level-1) ?>
  136. <?php if (empty($item->note)) : ?>
  137. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?>
  138. <?php else : ?>
  139. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note));?>
  140. <?php endif; ?></p>
  141. </td>
  142. <td class="center">
  143. <?php echo JHtml::_('jgrid.published', $item->published, $i, 'items.', $canChange);?>
  144. </td>
  145. <td class="order">
  146. <?php if ($canChange) : ?>
  147. <?php if ($saveOrder) : ?>
  148. <span><?php echo $this->pagination->orderUpIcon($i, isset($this->ordering[$item->parent_id][$orderkey - 1]), 'items.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  149. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, isset($this->ordering[$item->parent_id][$orderkey + 1]), 'items.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  150. <?php endif; ?>
  151. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  152. <input type="text" name="order[]" value="<?php echo $orderkey + 1;?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
  153. <?php $originalOrders[] = $orderkey + 1; ?>
  154. <?php else : ?>
  155. <?php echo $orderkey + 1;?>
  156. <?php endif; ?>
  157. </td>
  158. <td class="center">
  159. <?php echo $this->escape($item->access_level); ?>
  160. </td>
  161. <td class="nowrap">
  162. <span title="<?php echo isset($item->item_type_desc) ? htmlspecialchars($this->escape($item->item_type_desc), ENT_COMPAT, 'UTF-8') : ''; ?>">
  163. <?php echo $this->escape($item->item_type); ?></span>
  164. </td>
  165. <td class="center">
  166. <?php if ($item->type == 'component') : ?>
  167. <?php if ($item->language=='*' || $item->home=='0'):?>
  168. <?php echo JHtml::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange);?>
  169. <?php elseif ($canChange):?>
  170. <a href="<?php echo JRoute::_('index.php?option=com_menus&task=items.unsetDefault&cid[]='.$item->id.'&'.JUtility::getToken().'=1');?>">
  171. <?php echo JHtml::_('image', 'mod_languages/'.$item->image.'.gif', $item->language_title, array('title'=>JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);?>
  172. </a>
  173. <?php else:?>
  174. <?php echo JHtml::_('image', 'mod_languages/'.$item->image.'.gif', $item->language_title, array('title'=>$item->language_title), true);?>
  175. <?php endif;?>
  176. <?php endif; ?>
  177. </td>
  178. <td class="center">
  179. <?php if ($item->language==''):?>
  180. <?php echo JText::_('JDEFAULT'); ?>
  181. <?php elseif ($item->language=='*'):?>
  182. <?php echo JText::alt('JALL','language'); ?>
  183. <?php else:?>
  184. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  185. <?php endif;?>
  186. </td>
  187. <td class="center">
  188. <span title="<?php echo sprintf('%d-%d', $item->lft, $item->rgt);?>">
  189. <?php echo (int) $item->id; ?></span>
  190. </td>
  191. </tr>
  192. <?php endforeach; ?>
  193. </tbody>
  194. </table>
  195. <?php echo $this->pagination->getListFooter(); ?>
  196. <div class="clr"> </div>
  197. <?php echo $this->loadTemplate('batch'); ?>
  198. <input type="hidden" name="task" value="" />
  199. <input type="hidden" name="boxchecked" value="0" />
  200. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  201. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  202. <input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
  203. <?php echo JHtml::_('form.token'); ?>
  204. </form>