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

/administrator/templates/hathor/html/com_banners/banners/default.php

https://bitbucket.org/eternaware/joomus
PHP | 218 lines | 198 code | 13 blank | 7 comment | 25 complexity | a89bde1004745a2aceacf35f5978cd1f MD5 | raw file
Possible License(s): LGPL-2.1
  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. defined('_JEXEC') or die;
  10. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  11. JHtml::_('behavior.tooltip');
  12. JHtml::_('behavior.multiselect');
  13. $user = JFactory::getUser();
  14. $userId = $user->get('id');
  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_banners.category');
  18. $saveOrder = $listOrder == 'ordering';
  19. ?>
  20. <form action="<?php echo JRoute::_('index.php?option=com_banners&view=banners'); ?>" method="post" name="adminForm" id="adminForm">
  21. <fieldset id="filter-bar">
  22. <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend>
  23. <div class="filter-search">
  24. <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
  25. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('Banners_Search_in_title'); ?>" />
  26. <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  27. <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  28. </div>
  29. <div class="filter-select">
  30. <label class="selectlabel" for="filter_state">
  31. <?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?>
  32. </label>
  33. <select name="filter_state" class="inputbox" id="filter_state">
  34. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  35. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true);?>
  36. </select>
  37. <label class="selectlabel" for="filter_client_id">
  38. <?php echo JText::_('COM_BANNERS_SELECT_CLIENT'); ?>
  39. </label>
  40. <select name="filter_client_id" class="inputbox" id="filter_client_id">
  41. <option value=""><?php echo JText::_('COM_BANNERS_SELECT_CLIENT');?></option>
  42. <?php echo JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));?>
  43. </select>
  44. <label class="selectlabel" for="filter_category_id">
  45. <?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?>
  46. </label>
  47. <select name="filter_category_id" class="inputbox" id="filter_category_id">
  48. <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option>
  49. <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id'));?>
  50. </select>
  51. <label class="selectlabel" for="filter_language">
  52. <?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?>
  53. </label>
  54. <select name="filter_language" class="inputbox" id="filter_language">
  55. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  56. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  57. </select>
  58. <button type="submit" id="filter-go">
  59. <?php echo JText::_('JSUBMIT'); ?></button>
  60. </div>
  61. </fieldset>
  62. <div class="clr"> </div>
  63. <table class="adminlist">
  64. <thead>
  65. <tr>
  66. <th class="checkmark-col">
  67. <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
  68. </th>
  69. <th class="title">
  70. <?php echo JHtml::_('grid.sort', 'COM_BANNERS_HEADING_NAME', 'name', $listDirn, $listOrder); ?>
  71. </th>
  72. <th class="nowrap state-col">
  73. <?php echo JHtml::_('grid.sort', 'JSTATUS', 'state', $listDirn, $listOrder); ?>
  74. </th>
  75. <th class="nowrap width-5">
  76. <?php echo JHtml::_('grid.sort', 'COM_BANNERS_HEADING_STICKY', 'sticky', $listDirn, $listOrder); ?>
  77. </th>
  78. <th class="nowrap width-10">
  79. <?php echo JHtml::_('grid.sort', 'COM_BANNERS_HEADING_CLIENT', 'client_name', $listDirn, $listOrder); ?>
  80. </th>
  81. <th class="nowrap title category-col">
  82. <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'category_title', $listDirn, $listOrder); ?>
  83. </th>
  84. <th class="nowrap ordering-col">
  85. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'ordering', $listDirn, $listOrder); ?>
  86. <?php if ($canOrder && $saveOrder): ?>
  87. <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'banners.saveorder'); ?>
  88. <?php endif;?>
  89. </th>
  90. <th class="nowrap width-5">
  91. <?php echo JHtml::_('grid.sort', 'COM_BANNERS_HEADING_IMPRESSIONS', 'impmade', $listDirn, $listOrder); ?>
  92. </th>
  93. <th class="nowrap width-10">
  94. <?php echo JHtml::_('grid.sort', 'COM_BANNERS_HEADING_CLICKS', 'clicks', $listDirn, $listOrder); ?>
  95. </th>
  96. <th class="nowrap width-5">
  97. <?php echo JText::_('COM_BANNERS_HEADING_METAKEYWORDS'); ?>
  98. </th>
  99. <th class="width-10">
  100. <?php echo JText::_('COM_BANNERS_HEADING_PURCHASETYPE'); ?>
  101. </th>
  102. <th class="language-col">
  103. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
  104. </th>
  105. <th class="nowrap id-col">
  106. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
  107. </th>
  108. </tr>
  109. </thead>
  110. <tbody>
  111. <?php foreach ($this->items as $i => $item) :
  112. $ordering = ($listOrder == 'ordering');
  113. $item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_banners&task=edit&type=other&cid[]=' . $item->catid);
  114. $canCreate = $user->authorise('core.create', 'com_banners.category.' . $item->catid);
  115. $canEdit = $user->authorise('core.edit', 'com_banners.category.' . $item->catid);
  116. $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
  117. $canChange = $user->authorise('core.edit.state', 'com_banners.category.' . $item->catid) && $canCheckin;
  118. ?>
  119. <tr class="row<?php echo $i % 2; ?>">
  120. <td>
  121. <?php echo JHtml::_('grid.id', $i, $item->id); ?>
  122. </td>
  123. <td>
  124. <?php if ($item->checked_out) : ?>
  125. <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'banners.', $canCheckin); ?>
  126. <?php endif; ?>
  127. <?php if ($canEdit) : ?>
  128. <a href="<?php echo JRoute::_('index.php?option=com_banners&task=banner.edit&id='.(int) $item->id); ?>">
  129. <?php echo $this->escape($item->name); ?></a>
  130. <?php else : ?>
  131. <?php echo $this->escape($item->name); ?>
  132. <?php endif; ?>
  133. <p class="smallsub">
  134. <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?></p>
  135. </td>
  136. <td class="center">
  137. <?php echo JHtml::_('jgrid.published', $item->state, $i, 'banners.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
  138. </td>
  139. <td class="center">
  140. <?php echo JHtml::_('banner.pinned', $item->sticky, $i, $canChange);?>
  141. </td>
  142. <td class="center">
  143. <?php echo $item->client_name;?>
  144. </td>
  145. <td class="center">
  146. <?php echo $this->escape($item->category_title); ?>
  147. </td>
  148. <td class="order">
  149. <?php if ($canChange) : ?>
  150. <?php if ($saveOrder) : ?>
  151. <?php if ($listDirn == 'asc') : ?>
  152. <span><?php echo $this->pagination->orderUpIcon($i, (@$this->items[$i - 1]->catid == $item->catid), 'banners.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  153. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, (@$this->items[$i + 1]->catid == $item->catid), 'banners.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  154. <?php elseif ($listDirn == 'desc') : ?>
  155. <span><?php echo $this->pagination->orderUpIcon($i, (@$this->items[$i - 1]->catid == $item->catid), 'banners.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span>
  156. <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, (@$this->items[$i + 1]->catid == $item->catid), 'banners.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span>
  157. <?php endif; ?>
  158. <?php endif; ?>
  159. <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
  160. <input type="text" name="order[]" value="<?php echo $item->ordering;?>" <?php echo $disabled; ?> class="text-area-order" title="<?php echo $item->name; ?> order" />
  161. <?php else : ?>
  162. <?php echo $item->ordering; ?>
  163. <?php endif; ?>
  164. </td>
  165. <td class="center">
  166. <?php echo JText::sprintf('COM_BANNERS_IMPRESSIONS', $item->impmade, $item->imptotal ? $item->imptotal : JText::_('COM_BANNERS_UNLIMITED'));?>
  167. </td>
  168. <td class="center">
  169. <?php echo $item->clicks;?> -
  170. <?php echo sprintf('%.2f%%', $item->impmade ? 100 * $item->clicks / $item->impmade : 0);?>
  171. </td>
  172. <td>
  173. <?php echo $item->metakey; ?>
  174. </td>
  175. <td class="center">
  176. <?php if ($item->purchase_type < 0):?>
  177. <?php echo JText::sprintf('COM_BANNERS_DEFAULT', ($item->client_purchase_type > 0) ? JText::_('COM_BANNERS_FIELD_VALUE_'.$item->client_purchase_type) : JText::_('COM_BANNERS_FIELD_VALUE_'.$this->state->params->get('purchase_type')));?>
  178. <?php else:?>
  179. <?php echo JText::_('COM_BANNERS_FIELD_VALUE_'.$item->purchase_type);?>
  180. <?php endif;?>
  181. </td>
  182. <td class="center">
  183. <?php if ($item->language == '*'):?>
  184. <?php echo JText::alt('JALL', 'language'); ?>
  185. <?php else:?>
  186. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  187. <?php endif;?>
  188. </td>
  189. <td class="center">
  190. <?php echo $item->id; ?>
  191. </td>
  192. </tr>
  193. <?php endforeach; ?>
  194. </tbody>
  195. </table>
  196. <?php echo $this->pagination->getListFooter(); ?>
  197. <div class="clr"> </div>
  198. <?php //Load the batch processing form. ?>
  199. <?php echo $this->loadTemplate('batch'); ?>
  200. <input type="hidden" name="task" value="" />
  201. <input type="hidden" name="boxchecked" value="0" />
  202. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  203. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  204. <?php echo JHtml::_('form.token'); ?>
  205. </form>