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

https://bitbucket.org/eternaware/joomus · PHP · 186 lines · 167 code · 11 blank · 8 comment · 19 complexity · 7e8b431b27dc4374c4b17664f8e1f67b MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage Template.hathor
  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. /* 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. <fieldset id="filter-bar">
  23. <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
  24. <div class="filter-search">
  25. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  26. <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'); ?>" />
  27. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  28. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  29. </div>
  30. <div class="filter-select">
  31. <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label>
  32. <select name="filter_published" class="inputbox" id="filter_published">
  33. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  34. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
  35. </select>
  36. <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label>
  37. <select name="filter_access" class="inputbox" id="filter_access">
  38. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  39. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
  40. </select>
  41. <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label>
  42. <select name="filter_language" class="inputbox" id="filter_language">
  43. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  44. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  45. </select>
  46. <button type="submit" id="filter-go">
  47. <?php echo JText::_('JSUBMIT'); ?></button>
  48. </div>
  49. </fieldset>
  50. <div class="clr"> </div>
  51. <table class="adminlist">
  52. <thead>
  53. <tr>
  54. <th class="checkmark-col">
  55. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
  56. </th>
  57. <th class="title">
  58. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  59. </th>
  60. <th class="nowrap state-col">
  61. <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
  62. </th>
  63. <th class="title category-col">
  64. <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder); ?>
  65. </th>
  66. <th class="nowrap ordering-col">
  67. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'fp.ordering', $listDirn, $listOrder); ?>
  68. <?php if ($canOrder && $saveOrder) :?>
  69. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'featured.saveorder'); ?>
  70. <?php endif; ?>
  71. </th>
  72. <th class="title access-col">
  73. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
  74. </th>
  75. <th class="title created-by-col">
  76. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_CREATED_BY', 'a.created_by', $listDirn, $listOrder); ?>
  77. </th>
  78. <th class="title date-col">
  79. <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?>
  80. </th>
  81. <th class="hits-col">
  82. <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
  83. </th>
  84. <th class="language-col">
  85. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
  86. </th>
  87. <th class="nowrap id-col">
  88. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  89. </th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <?php
  94. foreach ($this->items as $i => $item) :
  95. $item->max_ordering = 0; //??
  96. $ordering = ($listOrder == 'fp.ordering');
  97. $assetId = 'com_content.article.' . $item->id;
  98. $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid);
  99. $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
  100. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0;
  101. $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin;
  102. ?>
  103. <tr class="row<?php echo $i % 2; ?>">
  104. <th class="center">
  105. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  106. </th>
  107. <td>
  108. <?php if ($item->checked_out) : ?>
  109. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'featured.', $canCheckin); ?>
  110. <?php endif; ?>
  111. <?php if ($canEdit) : ?>
  112. <a href="<?php echo JRoute::_('index.php?option=com_content&task=article.edit&return=featured&id='.$item->id);?>">
  113. <?php echo $this->escape($item->title); ?></a>
  114. <?php else : ?>
  115. <?php echo $this->escape($item->title); ?>
  116. <?php endif; ?>
  117. <p class="smallsub">
  118. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?></p>
  119. </td>
  120. <td class="center">
  121. <?php echo JHtml::_('jgrid.published', $item->state, $i, 'articles.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
  122. </td>
  123. <td class="center">
  124. <?php echo $this->escape($item->category_title); ?>
  125. </td>
  126. <td class="order">
  127. <?php if ($canChange) : ?>
  128. <?php if ($saveOrder) :?>
  129. <?php if ($listDirn == 'asc') : ?>
  130. <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  131. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  132. <?php elseif ($listDirn == 'desc') : ?>
  133. <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  134. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  135. <?php endif; ?>
  136. <?php endif; ?>
  137. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  138. <input type="text" name="order[]" value="<?php echo $item->ordering;?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
  139. <?php else : ?>
  140. <?php echo $item->ordering; ?>
  141. <?php endif; ?>
  142. </td>
  143. <td class="center">
  144. <?php echo $this->escape($item->access_level); ?>
  145. </td>
  146. <td class="center">
  147. <?php echo $this->escape($item->author_name); ?>
  148. </td>
  149. <td class="center nowrap">
  150. <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?>
  151. </td>
  152. <td class="center">
  153. <?php echo (int) $item->hits; ?>
  154. </td>
  155. <td class="center">
  156. <?php if ($item->language == '*'):?>
  157. <?php echo JText::alt('JALL', 'language'); ?>
  158. <?php else:?>
  159. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  160. <?php endif;?>
  161. </td>
  162. <td class="center">
  163. <?php echo (int) $item->id; ?>
  164. </td>
  165. </tr>
  166. <?php endforeach; ?>
  167. </tbody>
  168. </table>
  169. <?php echo $this->pagination->getListFooter(); ?>
  170. <input type="hidden" name="task" value="" />
  171. <input type="hidden" name="boxchecked" value="0" />
  172. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  173. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  174. <?php echo JHtml::_('form.token'); ?>
  175. </form>