PageRenderTime 41ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_menus/views/menus/tmpl/default.php

https://bitbucket.org/pastor399/newcastleunifc
PHP | 168 lines | 154 code | 5 blank | 9 comment | 10 complexity | e042188658dee444a4d0e4c417443de7 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage com_menus
  5. *
  6. * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. // Include the component HTML helpers.
  11. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
  12. // Load the tooltip behavior.
  13. JHtml::_('behavior.tooltip');
  14. JHtml::_('behavior.multiselect');
  15. JHtml::_('behavior.modal');
  16. JHtml::_('formbehavior.chosen', 'select');
  17. $uri = JUri::getInstance();
  18. $return = base64_encode($uri);
  19. $user = JFactory::getUser();
  20. $userId = $user->get('id');
  21. $listOrder = $this->escape($this->state->get('list.ordering'));
  22. $listDirn = $this->escape($this->state->get('list.direction'));
  23. $modMenuId = (int) $this->get('ModMenuId');
  24. ?>
  25. <script type="text/javascript">
  26. Joomla.submitbutton = function(task)
  27. {
  28. if (task != 'menus.delete' || confirm('<?php echo JText::_('COM_MENUS_MENU_CONFIRM_DELETE', true);?>'))
  29. {
  30. Joomla.submitform(task);
  31. }
  32. }
  33. </script>
  34. <form action="<?php echo JRoute::_('index.php?option=com_menus&view=menus');?>" method="post" name="adminForm" id="adminForm">
  35. <?php if (!empty( $this->sidebar)) : ?>
  36. <div id="j-sidebar-container" class="span2">
  37. <?php echo $this->sidebar; ?>
  38. </div>
  39. <div id="j-main-container" class="span10">
  40. <?php else : ?>
  41. <div id="j-main-container">
  42. <?php endif;?>
  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_MENUS_MENU_SEARCH_FILTER');?></label>
  46. <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('COM_MENUS_MENU_SEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_MENUS_ITEMS_SEARCH_FILTER'); ?>" />
  47. </div>
  48. <div class="btn-group pull-left hidden-phone">
  49. <button class="btn hasTooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
  50. <button class="btn hasTooltip" type="button" onclick="document.id('filter_search').value='';this.form.submit();" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>"><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>
  57. <div class="clearfix"> </div>
  58. <table class="table table-striped">
  59. <thead>
  60. <tr>
  61. <th width="1%">
  62. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
  63. </th>
  64. <th>
  65. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  66. </th>
  67. <th width="10%" class="nowrap center hidden-phone">
  68. <?php echo JText::_('COM_MENUS_HEADING_PUBLISHED_ITEMS'); ?>
  69. </th>
  70. <th width="10%" class="nowrap center hidden-phone">
  71. <?php echo JText::_('COM_MENUS_HEADING_UNPUBLISHED_ITEMS'); ?>
  72. </th>
  73. <th width="10%" class="nowrap center hidden-phone">
  74. <?php echo JText::_('COM_MENUS_HEADING_TRASHED_ITEMS'); ?>
  75. </th>
  76. <th width="20%" class="nowrap hidden-phone">
  77. <?php echo JText::_('COM_MENUS_HEADING_LINKED_MODULES'); ?>
  78. </th>
  79. <th width="1%" class="center nowrap">
  80. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  81. </th>
  82. </tr>
  83. </thead>
  84. <tfoot>
  85. <tr>
  86. <td colspan="15">
  87. <?php echo $this->pagination->getListFooter(); ?>
  88. </td>
  89. </tr>
  90. </tfoot>
  91. <tbody>
  92. <?php foreach ($this->items as $i => $item) :
  93. $canCreate = $user->authorise('core.create', 'com_menus');
  94. $canEdit = $user->authorise('core.edit', 'com_menus');
  95. $canChange = $user->authorise('core.edit.state', 'com_menus');
  96. ?>
  97. <tr class="row<?php echo $i % 2; ?>">
  98. <td class="center">
  99. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  100. </td>
  101. <td>
  102. <a href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype) ?> ">
  103. <?php echo $this->escape($item->title); ?></a>
  104. <p class="small">(<span><?php echo JText::_('COM_MENUS_MENU_MENUTYPE_LABEL') ?></span>
  105. <?php if ($canEdit) : ?>
  106. <?php echo '<a href="'.JRoute::_('index.php?option=com_menus&task=menu.edit&id='.$item->id).' title='.$this->escape($item->description).'">'.
  107. $this->escape($item->menutype).'</a>'; ?>)
  108. <?php else : ?>
  109. <?php echo $this->escape($item->menutype)?>)
  110. <?php endif; ?>
  111. </p>
  112. </td>
  113. <td class="center btns">
  114. <a class="badge badge-success" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=1');?>">
  115. <?php echo $item->count_published; ?></a>
  116. </td>
  117. <td class="center btns">
  118. <a class="badge" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=0');?>">
  119. <?php echo $item->count_unpublished; ?></a>
  120. </td>
  121. <td class="center btns">
  122. <a class="badge badge-error" href="<?php echo JRoute::_('index.php?option=com_menus&view=items&menutype='.$item->menutype.'&filter_published=-2');?>">
  123. <?php echo $item->count_trashed; ?></a>
  124. </td>
  125. <td class="left">
  126. <?php if (isset($this->modules[$item->menutype])) : ?>
  127. <div class="btn-group">
  128. <a href="#" class="btn btn-small dropdown-toggle" data-toggle="dropdown">
  129. <?php echo JText::_('COM_MENUS_MODULES') ?>
  130. <b class="caret"></b>
  131. </a>
  132. <ul class="dropdown-menu">
  133. <?php foreach ($this->modules[$item->menutype] as &$module) : ?>
  134. <li>
  135. <?php if ($canEdit) : ?>
  136. <a class="small modal" href="<?php echo JRoute::_('index.php?option=com_modules&task=module.edit&id='.$module->id.'&return='.$return.'&tmpl=component&layout=modal');?>" rel="{handler: 'iframe', size: {x: 1024, y: 450}, onClose: function() {window.location.reload()}}" title="<?php echo JText::_('COM_MENUS_EDIT_MODULE_SETTINGS');?>">
  137. <?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?></a>
  138. <?php else :?>
  139. <?php echo JText::sprintf('COM_MENUS_MODULE_ACCESS_POSITION', $this->escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?>
  140. <?php endif; ?>
  141. </li>
  142. <?php endforeach; ?>
  143. </ul>
  144. </div>
  145. <?php elseif ($modMenuId) : ?>
  146. <a href="<?php echo JRoute::_('index.php?option=com_modules&task=module.add&eid=' . $modMenuId . '&params[menutype]='.$item->menutype); ?>">
  147. <?php echo JText::_('COM_MENUS_ADD_MENU_MODULE'); ?></a>
  148. <?php endif; ?>
  149. </td>
  150. <td class="center">
  151. <?php echo $item->id; ?>
  152. </td>
  153. </tr>
  154. <?php endforeach; ?>
  155. </tbody>
  156. </table>
  157. <input type="hidden" name="task" value="" />
  158. <input type="hidden" name="boxchecked" value="0" />
  159. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  160. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  161. <?php echo JHtml::_('form.token'); ?>
  162. </div>
  163. </form>