/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php
PHP | 233 lines | 212 code | 11 blank | 10 comment | 32 complexity | 99b8adb78af7a87d1eaacc90cbca3661 MD5 | raw file
Possible License(s): LGPL-2.1
1<?php 2/** 3 * @package Joomla.Administrator 4 * @subpackage com_newsfeeds 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 10defined('_JEXEC') or die; 11 12// Include the component HTML helpers. 13JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); 14JHtml::_('behavior.tooltip'); 15JHtml::_('behavior.multiselect'); 16 17$user = JFactory::getUser(); 18$userId = $user->get('id'); 19$listOrder = $this->escape($this->state->get('list.ordering')); 20$listDirn = $this->escape($this->state->get('list.direction')); 21$archived = $this->state->get('filter.published') == 2 ? true : false; 22$trashed = $this->state->get('filter.published') == -2 ? true : false; 23$canOrder = $user->authorise('core.edit.state', 'com_newsfeeds.category'); 24$saveOrder = $listOrder == 'a.ordering'; 25if ($saveOrder) 26{ 27 $saveOrderingUrl = 'index.php?option=com_newsfeeds&task=newsfeeds.saveOrderAjax&tmpl=component'; 28 JHtml::_('sortablelist.sortable', 'articleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); 29} 30$sortFields = $this->getSortFields(); 31?> 32<script type="text/javascript"> 33 Joomla.orderTable = function() { 34 table = document.getElementById("sortTable"); 35 direction = document.getElementById("directionTable"); 36 order = table.options[table.selectedIndex].value; 37 if (order != '<?php echo $listOrder; ?>') { 38 dirn = 'asc'; 39 } else { 40 dirn = direction.options[direction.selectedIndex].value; 41 } 42 Joomla.tableOrdering(order, dirn, ''); 43 } 44</script> 45<form action="<?php echo JRoute::_('index.php?option=com_newsfeeds&view=newsfeeds'); ?>" method="post" name="adminForm" id="adminForm"> 46 <div id="filter-bar" class="btn-toolbar"> 47 <div class="filter-search btn-group pull-left"> 48 <label for="filter_search" class="element-invisible"><?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC');?></label> 49 <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('COM_NEWSFEEDS_SEARCH_IN_TITLE'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_NEWSFEEDS_SEARCH_IN_TITLE'); ?>" /> 50 </div> 51 <div class="btn-group pull-left hidden-phone"> 52 <button class="btn" rel="tooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button> 53 <button class="btn" rel="tooltip" type="button" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button> 54 </div> 55 <div class="btn-group pull-right hidden-phone"> 56 <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label> 57 <?php echo $this->pagination->getLimitBox(); ?> 58 </div> 59 <div class="btn-group pull-right hidden-phone"> 60 <label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label> 61 <select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()"> 62 <option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option> 63 <option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option> 64 <option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option> 65 </select> 66 </div> 67 <div class="btn-group pull-right"> 68 <label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label> 69 <select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()"> 70 <option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option> 71 <?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?> 72 </select> 73 </div> 74 </div> 75 <div class="clearfix"> </div> 76 <table class="table table-striped" id="articleList"> 77 <thead> 78 <tr> 79 <th width="1%" class="nowrap center hidden-phone"> 80 <?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> 81 </th> 82 <th width="1%" class="hidden-phone"> 83 <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> 84 </th> 85 <th width="5%" class="nowrap center"> 86 <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> 87 </th> 88 <th class="title"> 89 <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?> 90 </th> 91 <th width="5%" class="nowrap hidden-phone"> 92 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?> 93 </th> 94 <th width="10%" class="nowrap hidden-phone"> 95 <?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_NUM_ARTICLES_HEADING', 'numarticles', $listDirn, $listOrder); ?> 96 </th> 97 <th width="5%" class="nowrap hidden-phone"> 98 <?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_CACHE_TIME_HEADING', 'a.cache_time', $listDirn, $listOrder); ?> 99 </th> 100 <th width="5%" class="nowrap hidden-phone"> 101 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?> 102 </th> 103 <th width="1%" class="nowrap center hidden-phone"> 104 <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> 105 </th> 106 </tr> 107 </thead> 108 <tfoot> 109 <tr> 110 <td colspan="11"> 111 <?php echo $this->pagination->getListFooter(); ?> 112 </td> 113 </tr> 114 </tfoot> 115 <tbody> 116 <?php foreach ($this->items as $i => $item) : 117 $ordering = ($listOrder == 'a.ordering'); 118 $canCreate = $user->authorise('core.create', 'com_newsfeeds.category.' . $item->catid); 119 $canEdit = $user->authorise('core.edit', 'com_newsfeeds.category.' . $item->catid); 120 $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0; 121 $canChange = $user->authorise('core.edit.state', 'com_newsfeeds.category.' . $item->catid) && $canCheckin; 122 ?> 123 <tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->catid?>"> 124 <td class="order nowrap center hidden-phone"> 125 <?php if ($canChange) : 126 $disableClassName = ''; 127 $disabledLabel = ''; 128 if (!$saveOrder) : 129 $disabledLabel = JText::_('JORDERINGDISABLED'); 130 $disableClassName = 'inactive tip-top'; 131 endif; ?> 132 <span class="sortable-handler <?php echo $disableClassName?>" title="<?php echo $disabledLabel?>" rel="tooltip"> 133 <i class="icon-menu"></i> 134 </span> 135 <input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering;?>" class="width-20 text-area-order " /> 136 <?php else : ?> 137 <span class="sortable-handler inactive" > 138 <i class="icon-menu"></i> 139 </span> 140 <?php endif; ?> 141 </td> 142 <td class="center hidden-phone"> 143 <?php echo JHtml::_('grid.id', $i, $item->id); ?> 144 </td> 145 <td class="center"> 146 <?php echo JHtml::_('jgrid.published', $item->published, $i, 'newsfeeds.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> 147 </td> 148 <td class="nowrap has-context"> 149 <div class="pull-left"> 150 <?php if ($item->checked_out) : ?> 151 <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'newsfeeds.', $canCheckin); ?> 152 <?php endif; ?> 153 <?php if ($canEdit) : ?> 154 <a href="<?php echo JRoute::_('index.php?option=com_newsfeeds&task=newsfeed.edit&id='.(int) $item->id); ?>"> 155 <?php echo $this->escape($item->name); ?></a> 156 <?php else : ?> 157 <?php echo $this->escape($item->name); ?> 158 <?php endif; ?> 159 <span class="small"> 160 <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?> 161 </span> 162 <div class="small"> 163 <?php echo $this->escape($item->category_title); ?> 164 </div> 165 </div> 166 <div class="pull-left"> 167 <?php 168 // Create dropdown items 169 JHtml::_('dropdown.edit', $item->id, 'newsfeed.'); 170 JHtml::_('dropdown.divider'); 171 if ($item->published) : 172 JHtml::_('dropdown.unpublish', 'cb' . $i, 'newsfeeds.'); 173 else : 174 JHtml::_('dropdown.publish', 'cb' . $i, 'newsfeeds.'); 175 endif; 176 177 JHtml::_('dropdown.divider'); 178 179 if ($archived) : 180 JHtml::_('dropdown.unarchive', 'cb' . $i, 'newsfeeds.'); 181 else : 182 JHtml::_('dropdown.archive', 'cb' . $i, 'newsfeeds.'); 183 endif; 184 185 if ($item->checked_out) : 186 JHtml::_('dropdown.checkin', 'cb' . $i, 'newsfeeds.'); 187 endif; 188 189 if ($trashed) : 190 JHtml::_('dropdown.untrash', 'cb' . $i, 'newsfeeds.'); 191 else : 192 JHtml::_('dropdown.trash', 'cb' . $i, 'newsfeeds.'); 193 endif; 194 195 // render dropdown list 196 echo JHtml::_('dropdown.render'); 197 ?> 198 </div> 199 200 </td> 201 <td class="small hidden-phone"> 202 <?php echo $this->escape($item->access_level); ?> 203 </td> 204 <td class="center hidden-phone"> 205 <?php echo (int) $item->numarticles; ?> 206 </td> 207 <td class="center hidden-phone"> 208 <?php echo (int) $item->cache_time; ?> 209 </td> 210 <td class="small hidden-phone"> 211 <?php if ($item->language == '*'):?> 212 <?php echo JText::alt('JALL', 'language'); ?> 213 <?php else:?> 214 <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> 215 <?php endif;?> 216 </td> 217 <td class="center hidden-phone"> 218 <?php echo (int) $item->id; ?> 219 </td> 220 </tr> 221 <?php endforeach; ?> 222 </tbody> 223 </table> 224 225 <?php //Load the batch processing form. ?> 226 <?php echo $this->loadTemplate('batch'); ?> 227 228 <input type="hidden" name="task" value="" /> 229 <input type="hidden" name="boxchecked" value="0" /> 230 <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> 231 <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> 232 <?php echo JHtml::_('form.token'); ?> 233</form>