PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/administrator/templates/hathor/html/com_content/featured/default.php

https://bitbucket.org/pastor399/newcastleunifc
PHP | 212 lines | 191 code | 13 blank | 8 comment | 24 complexity | fadc4808f3bf764627899be3be43899f MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage Template.hathor
  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. /* add accessibility, labels on input forms */
  10. defined('_JEXEC') or die;
  11. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  12. JHtml::_('behavior.tooltip');
  13. JHtml::_('behavior.multiselect');
  14. $user = JFactory::getUser();
  15. $listOrder = $this->escape($this->state->get('list.ordering'));
  16. $listDirn = $this->escape($this->state->get('list.direction'));
  17. $canOrder = $user->authorise('core.edit.state', 'com_content.article');
  18. $saveOrder = $listOrder == 'fp.ordering';
  19. $n = count($this->items);
  20. ?>
  21. <form action="<?php echo JRoute::_('index.php?option=com_content&view=featured'); ?>" method="post" name="adminForm" id="adminForm">
  22. <?php if (!empty( $this->sidebar)) : ?>
  23. <div id="j-sidebar-container" class="span2">
  24. <?php echo $this->sidebar; ?>
  25. </div>
  26. <div id="j-main-container" class="span10">
  27. <?php else : ?>
  28. <div id="j-main-container">
  29. <?php endif;?>
  30. <fieldset id="filter-bar">
  31. <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
  32. <div class="filter-search">
  33. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  34. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" />
  35. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  36. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  37. </div>
  38. <div class="filter-select">
  39. <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label>
  40. <select name="filter_published" class="inputbox" id="filter_published">
  41. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option>
  42. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true); ?>
  43. </select>
  44. <label class="selectlabel" for="filter_category_id"><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></label>
  45. <select name="filter_category_id" class="inputbox" id="filter_category_id">
  46. <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></option>
  47. <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id')); ?>
  48. </select>
  49. <label class="selectlabel" for="filter_level"><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></label>
  50. <select name="filter_level" class="inputbox" id="filter_level">
  51. <option value=""><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></option>
  52. <?php echo JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')); ?>
  53. </select>
  54. <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label>
  55. <select name="filter_access" class="inputbox" id="filter_access">
  56. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  57. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?>
  58. </select>
  59. <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label>
  60. <select name="filter_language" class="inputbox" id="filter_language">
  61. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></option>
  62. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')); ?>
  63. </select>
  64. <button type="submit" id="filter-go">
  65. <?php echo JText::_('JSUBMIT'); ?></button>
  66. </div>
  67. </fieldset>
  68. <div class="clr"> </div>
  69. <table class="adminlist">
  70. <thead>
  71. <tr>
  72. <th class="checkmark-col">
  73. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
  74. </th>
  75. <th class="title">
  76. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  77. </th>
  78. <th class="nowrap state-col">
  79. <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  80. </th>
  81. <th class="title category-col">
  82. <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder); ?>
  83. </th>
  84. <th class="nowrap ordering-col">
  85. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'fp.ordering', $listDirn, $listOrder); ?>
  86. <?php if ($canOrder && $saveOrder) :?>
  87. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'featured.saveorder'); ?>
  88. <?php endif; ?>
  89. </th>
  90. <th class="title access-col">
  91. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
  92. </th>
  93. <th class="title created-by-col">
  94. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_CREATED_BY', 'a.created_by', $listDirn, $listOrder); ?>
  95. </th>
  96. <th class="title date-col">
  97. <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?>
  98. </th>
  99. <th class="hits-col">
  100. <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
  101. </th>
  102. <th class="language-col">
  103. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
  104. </th>
  105. <th class="nowrap id-col">
  106. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  107. </th>
  108. </tr>
  109. </thead>
  110. <tbody>
  111. <?php
  112. foreach ($this->items as $i => $item) :
  113. $item->max_ordering = 0; //??
  114. $ordering = ($listOrder == 'fp.ordering');
  115. $assetId = 'com_content.article.' . $item->id;
  116. $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid);
  117. $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
  118. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0;
  119. $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin;
  120. ?>
  121. <tr class="row<?php echo $i % 2; ?>">
  122. <th class="center">
  123. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  124. </th>
  125. <td>
  126. <?php if ($item->checked_out) : ?>
  127. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'featured.', $canCheckin); ?>
  128. <?php endif; ?>
  129. <?php if ($canEdit) : ?>
  130. <a href="<?php echo JRoute::_('index.php?option=com_content&task=article.edit&return=featured&id='.$item->id);?>">
  131. <?php echo $this->escape($item->title); ?></a>
  132. <?php else : ?>
  133. <?php echo $this->escape($item->title); ?>
  134. <?php endif; ?>
  135. <p class="smallsub">
  136. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?></p>
  137. </td>
  138. <td class="center">
  139. <?php echo JHtml::_('jgrid.published', $item->state, $i, 'articles.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
  140. </td>
  141. <td class="center">
  142. <?php echo $this->escape($item->category_title); ?>
  143. </td>
  144. <td class="order">
  145. <?php if ($canChange) : ?>
  146. <?php if ($saveOrder) : ?>
  147. <?php if ($listDirn == 'asc') : ?>
  148. <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  149. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  150. <?php elseif ($listDirn == 'desc') : ?>
  151. <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  152. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  153. <?php endif; ?>
  154. <?php endif; ?>
  155. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  156. <input type="text" name="order[]" value="<?php echo $item->ordering; ?>" <?php echo $disabled; ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
  157. <?php else : ?>
  158. <?php echo $item->ordering; ?>
  159. <?php endif; ?>
  160. </td>
  161. <td class="center">
  162. <?php echo $this->escape($item->access_level); ?>
  163. </td>
  164. <td class="center">
  165. <?php if ($item->created_by_alias) : ?>
  166. <?php echo $this->escape($item->author_name); ?>
  167. <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->created_by_alias)); ?></p>
  168. <?php else : ?>
  169. <?php echo $this->escape($item->author_name); ?>
  170. <?php endif; ?>
  171. </td>
  172. <td class="center nowrap">
  173. <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?>
  174. </td>
  175. <td class="center">
  176. <?php echo (int) $item->hits; ?>
  177. </td>
  178. <td class="center">
  179. <?php if ($item->language == '*') : ?>
  180. <?php echo JText::alt('JALL', 'language'); ?>
  181. <?php else : ?>
  182. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  183. <?php endif;?>
  184. </td>
  185. <td class="center">
  186. <?php echo (int) $item->id; ?>
  187. </td>
  188. </tr>
  189. <?php endforeach; ?>
  190. </tbody>
  191. </table>
  192. <?php echo $this->pagination->getListFooter(); ?>
  193. <input type="hidden" name="task" value="" />
  194. <input type="hidden" name="boxchecked" value="0" />
  195. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  196. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  197. <?php echo JHtml::_('form.token'); ?>
  198. </div>
  199. </form>