PageRenderTime 38ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/templates/hathor/html/com_weblinks/weblinks/default.php

https://github.com/3den/J-MediaGalleries
PHP | 191 lines | 168 code | 14 blank | 9 comment | 21 complexity | 325c471ad6916a7acc602204390ddea7 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: default.php 19232 2010-10-27 12:52:54Z 3dentech $
  4. * @package Joomla.Administrator
  5. * @subpackage templates.hathor
  6. * @copyright Copyright (C) 2005 - 2010 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. JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers'.DS.'html');
  13. JHtml::_('behavior.tooltip');
  14. JHtml::_('script','system/multiselect.js',false,true);
  15. $user = JFactory::getUser();
  16. $userId = $user->get('id');
  17. $listOrder = $this->state->get('list.ordering');
  18. $listDirn = $this->state->get('list.direction');
  19. $canOrder = $user->authorise('core.edit.state', 'com_weblinks.category');
  20. $saveOrder = $listOrder == 'a.ordering';
  21. ?>
  22. <form action="<?php echo JRoute::_('index.php?option=com_weblinks'); ?>" method="post" name="adminForm" id="adminForm">
  23. <fieldset id="filter-bar">
  24. <legend class="element-invisible"><?php echo JText::_('Filters'); ?></legend>
  25. <div class="filter-search">
  26. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  27. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" title="<?php echo JText::_('COM_WEBLINKS_SEARCH_IN_TITLE'); ?>" />
  28. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  29. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  30. </div>
  31. <div class="filter-select">
  32. <label class="selectlabel" for="filter_published">
  33. <?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?>
  34. </label>
  35. <select name="filter_published" id="filter_published" class="inputbox">
  36. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  37. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
  38. </select>
  39. <label class="selectlabel" for="filter_category_id">
  40. <?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?>
  41. </label>
  42. <select name="filter_category_id" id="filter_category_id" class="inputbox">
  43. <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option>
  44. <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_weblinks'), 'value', 'text', $this->state->get('filter.category_id'));?>
  45. </select>
  46. <label class="selectlabel" for="filter_access">
  47. <?php echo JText::_('JOPTION_SELECT_ACCESS'); ?>
  48. </label>
  49. <select name="filter_access" id="filter_access" class="inputbox">
  50. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  51. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
  52. </select>
  53. <label class="selectlabel" for="filter_language">
  54. <?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?>
  55. </label>
  56. <select name="filter_language" id="filter_language" class="inputbox">
  57. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  58. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  59. </select>
  60. <button type="button" id="filter-go" onclick="this.form.submit();">
  61. <?php echo JText::_('JSUBMIT'); ?></button>
  62. </div>
  63. </fieldset>
  64. <div class="clr"> </div>
  65. <table class="adminlist">
  66. <thead>
  67. <tr>
  68. <th class="checkmark-col">
  69. <input type="checkbox" name="checkall-toggle" id="toggle" value="" title="<?php echo JText::_('TPL_HATHOR_CHECKMARK_ALL'); ?>" onclick="checkAll(this)" />
  70. </th>
  71. <th class="title">
  72. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  73. </th>
  74. <th class="nowrap state-col">
  75. <?php echo JHtml::_('grid.sort', 'JPUBLISHED', 'a.state', $listDirn, $listOrder); ?>
  76. </th>
  77. <th class="nowrap title category-col">
  78. <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'category_title', $listDirn, $listOrder); ?>
  79. </th>
  80. <th class="nowrap ordering-col">
  81. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'a.ordering', $listDirn, $listOrder); ?>
  82. <?php if ($canOrder && $saveOrder) :?>
  83. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'weblinks.saveorder'); ?>
  84. <?php endif; ?>
  85. </th>
  86. <th class="title access-col">
  87. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
  88. </th>
  89. <th class="hits-col">
  90. <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
  91. </th>
  92. <th class="width-5">
  93. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
  94. </th>
  95. <th class="nowrap id-col">
  96. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  97. </th>
  98. </tr>
  99. </thead>
  100. <tbody>
  101. <?php
  102. $n = count($this->items);
  103. foreach ($this->items as $i => $item) :
  104. $ordering = ($listOrder == 'a.ordering');
  105. $item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_weblinks&task=edit&type=other&cid[]='. $item->catid);
  106. $canCreate = $user->authorise('core.create', 'com_weblinks.category.'.$item->catid);
  107. $canEdit = $user->authorise('core.edit', 'com_weblinks.category.'.$item->catid);
  108. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
  109. $canChange = $user->authorise('core.edit.state', 'com_weblinks.category.'.$item->catid) && $canCheckin;
  110. ?>
  111. <tr class="row<?php echo $i % 2; ?>">
  112. <td>
  113. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  114. </td>
  115. <td>
  116. <?php if ($item->checked_out) : ?>
  117. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
  118. <?php endif; ?>
  119. <?php if ($canEdit) : ?>
  120. <a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id='.(int) $item->id); ?>">
  121. <?php echo $this->escape($item->title); ?></a>
  122. <?php else : ?>
  123. <?php echo $this->escape($item->title); ?>
  124. <?php endif; ?>
  125. <p class="smallsub">
  126. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?></p>
  127. </td>
  128. <td class="center">
  129. <?php echo JHtml::_('jgrid.published', $item->state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
  130. </td>
  131. <td class="center">
  132. <?php echo $this->escape($item->category_title); ?>
  133. </td>
  134. <td class="order">
  135. <?php if ($canChange) : ?>
  136. <?php if ($saveOrder) :?>
  137. <?php if ($listDirn == 'asc') : ?>
  138. <span><?php echo $this->pagination->orderUpIcon($i, ($item->catid == @$this->items[$i-1]->catid), 'weblinks.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  139. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, ($item->catid == @$this->items[$i+1]->catid), 'weblinks.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  140. <?php elseif ($listDirn == 'desc') : ?>
  141. <span><?php echo $this->pagination->orderUpIcon($i, ($item->catid == @$this->items[$i-1]->catid), 'weblinks.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  142. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, ($item->catid == @$this->items[$i+1]->catid), 'weblinks.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  143. <?php endif; ?>
  144. <?php endif; ?>
  145. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  146. <input type="text" name="order[]" value="<?php echo $item->ordering;?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
  147. <?php else : ?>
  148. <?php echo $item->ordering; ?>
  149. <?php endif; ?>
  150. </td>
  151. <td class="center">
  152. <?php echo $this->escape($item->access_level); ?>
  153. </td>
  154. <td class="center">
  155. <?php echo $item->hits; ?>
  156. </td>
  157. <td class="center">
  158. <?php if ($item->language=='*'):?>
  159. <?php echo JText::_('JALL'); ?>
  160. <?php else:?>
  161. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  162. <?php endif;?>
  163. </td>
  164. <td class="center">
  165. <?php echo $item->id; ?>
  166. </td>
  167. </tr>
  168. <?php endforeach; ?>
  169. </tbody>
  170. </table>
  171. <?php echo $this->pagination->getListFooter(); ?>
  172. <input type="hidden" name="task" value="" />
  173. <input type="hidden" name="boxchecked" value="0" />
  174. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  175. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  176. <?php echo JHtml::_('form.token'); ?>
  177. </form>