Advertisement
pusatdata

J15: Menu Category List 2 Coloumn

Jul 25th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.54 KB | None | 0 0
  1. /components/com_content/views/category/tmpl/default_items.php:
  2. http://forum.joomla.org/viewtopic.php?p=2604065
  3. ============================
  4.  
  5.  
  6.  
  7. <?php // no direct access
  8. defined('_JEXEC') or die('Restricted access'); ?>
  9. <script language="javascript" type="text/javascript">
  10.  
  11. function tableOrdering( order, dir, task )
  12. {
  13. var form = document.adminForm;
  14.  
  15. form.filter_order.value = order;
  16. form.filter_order_Dir.value = dir;
  17. document.adminForm.submit( task );
  18. }
  19. </script>
  20. <form action="<?php echo $this->action; ?>" method="post" name="adminForm">
  21.  
  22. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  23. <?php if ($this->params->get('filter') || $this->params->get('show_pagination_limit')) : ?>
  24. <tr>
  25. <td colspan="5">
  26. <table width=100% border="0">
  27. <tr>
  28. <?php if ($this->params->get('filter')) : ?>
  29. <td align="left" width="60%" nowrap="nowrap">
  30. <?php echo JText::_($this->params->get('filter_type') . ' Filter').'&nbsp;'; ?>
  31. <input type="text" name="filter" value="<?php echo $this->escape($this->lists['filter']);?>" class="inputbox" onchange="document.adminForm.submit();" />
  32. </td>
  33. <?php endif; ?>
  34. <?php if ($this->params->get('show_pagination_limit')) : ?>
  35. <td align="right" width="40%" nowrap="nowrap">
  36. <?php
  37. echo '&nbsp;&nbsp;&nbsp;'.JText::_('Display Num').'&nbsp;';
  38. echo $this->pagination->getLimitBox();
  39. ?>
  40. </td>
  41. <?php endif; ?>
  42. </tr>
  43. </table>
  44. </td>
  45. </tr>
  46. <?php endif; ?>
  47. </table>
  48.  
  49. <table width=100%><tr><td valign="top" width=50%>
  50. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  51. <?php if ($this->params->get('show_headings')) : ?>
  52. <tr>
  53. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" align="right" width="5%">
  54. <?php echo JText::_('Num'); ?>
  55. </td>
  56. <?php if ($this->params->get('show_title')) : ?>
  57. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" >
  58. <?php echo JHTML::_('grid.sort', 'Item Title', 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  59. </td>
  60. <?php endif; ?>
  61. <?php if ($this->params->get('show_date')) : ?>
  62. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="25%">
  63. <?php echo JHTML::_('grid.sort', 'Date', 'a.created', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  64. </td>
  65. <?php endif; ?>
  66. <?php if ($this->params->get('show_author')) : ?>
  67. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="20%">
  68. <?php echo JHTML::_('grid.sort', 'Author', 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  69. </td>
  70. <?php endif; ?>
  71. <?php if ($this->params->get('show_hits')) : ?>
  72. <td align="center" class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="5%" nowrap="nowrap">
  73. <?php echo JHTML::_('grid.sort', 'Hits', 'a.hits', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  74. </td>
  75. <?php endif; ?>
  76.  
  77. </tr>
  78. <?php endif; ?>
  79.  
  80. <?php foreach ($this->items as $item) : ?>
  81. <?php if (!$item->odd) : ?>
  82. <tr class="sectiontableentry<?php echo ($item->odd +1 ) . $this->escape($this->params->get('pageclass_sfx')); ?>" >
  83. <td align="right">
  84. <?php echo $this->pagination->getRowOffset( $item->count ); ?>
  85. </td>
  86. <?php if ($this->params->get('show_title')) : ?>
  87. <?php if ($item->access <= $this->user->get('aid', 0)) : ?>
  88. <td>
  89. <a href="<?php echo $item->link; ?>">
  90. <?php echo $this->escape($item->title); ?></a>
  91. <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
  92. </td>
  93. <?php else : ?>
  94. <td>
  95. <?php
  96. echo $this->escape($item->title).' : ';
  97. $link = JRoute::_('index.php?option=com_user&view=login');
  98. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false);
  99. $fullURL = new JURI($link);
  100. $fullURL->setVar('return', base64_encode($returnURL));
  101. $link = $fullURL->toString();
  102. ?>
  103. <a href="<?php echo $link; ?>">
  104. <?php echo JText::_( 'Register to read more...' ); ?></a>
  105. </td>
  106. <?php endif; ?>
  107. <?php endif; ?>
  108. <?php if ($this->params->get('show_date')) : ?>
  109. <td>
  110. <?php echo $item->created; ?>
  111. </td>
  112. <?php endif; ?>
  113. <?php if ($this->params->get('show_author')) : ?>
  114. <td >
  115. <?php echo $this->escape($item->created_by_alias) ? $this->escape($item->created_by_alias) : $this->escape($item->author); ?>
  116. </td>
  117. <?php endif; ?>
  118. <?php if ($this->params->get('show_hits')) : ?>
  119. <td align="center">
  120. <?php echo $this->escape($item->hits) ? $this->escape($item->hits) : '-'; ?>
  121. </td>
  122. <?php endif; ?>
  123. </tr>
  124. <?php endif; ?>
  125. <?php endforeach; ?>
  126. </table>
  127. </td><td valign="top" width=50%>
  128. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  129. <?php if ($this->params->get('show_headings')) : ?>
  130. <tr>
  131. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" align="right" width="5%">
  132. <?php echo JText::_('Num'); ?>
  133. </td>
  134. <?php if ($this->params->get('show_title')) : ?>
  135. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" >
  136. <?php echo JHTML::_('grid.sort', 'Item Title', 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  137. </td>
  138. <?php endif; ?>
  139. <?php if ($this->params->get('show_date')) : ?>
  140. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="25%">
  141. <?php echo JHTML::_('grid.sort', 'Date', 'a.created', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  142. </td>
  143. <?php endif; ?>
  144. <?php if ($this->params->get('show_author')) : ?>
  145. <td class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="20%">
  146. <?php echo JHTML::_('grid.sort', 'Author', 'author', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  147. </td>
  148. <?php endif; ?>
  149. <?php if ($this->params->get('show_hits')) : ?>
  150. <td align="center" class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" width="5%" nowrap="nowrap">
  151. <?php echo JHTML::_('grid.sort', 'Hits', 'a.hits', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  152. </td>
  153. <?php endif; ?>
  154.  
  155. </tr>
  156. <?php endif; ?>
  157.  
  158. <?php foreach ($this->items as $item ) : ?>
  159. <?php if ($item->odd) : ?>
  160. <tr class="sectiontableentry<?php echo ($item->odd +1 ) . $this->escape($this->params->get('pageclass_sfx')); ?>" >
  161. <td align="right">
  162. <?php echo $this->pagination->getRowOffset( $item->count ); ?>
  163. </td>
  164. <?php if ($this->params->get('show_title')) : ?>
  165. <?php if ($item->access <= $this->user->get('aid', 0)) : ?>
  166. <td>
  167. <a href="<?php echo $item->link; ?>">
  168. <?php echo $this->escape($item->title); ?></a>
  169. <?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
  170. </td>
  171. <?php else : ?>
  172. <td>
  173. <?php
  174. echo $this->escape($item->title).' : ';
  175. $link = JRoute::_('index.php?option=com_user&view=login');
  176. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid), false);
  177. $fullURL = new JURI($link);
  178. $fullURL->setVar('return', base64_encode($returnURL));
  179. $link = $fullURL->toString();
  180. ?>
  181. <a href="<?php echo $link; ?>">
  182. <?php echo JText::_( 'Register to read more...' ); ?></a>
  183. </td>
  184. <?php endif; ?>
  185. <?php endif; ?>
  186. <?php if ($this->params->get('show_date')) : ?>
  187. <td>
  188. <?php echo $item->created; ?>
  189. </td>
  190. <?php endif; ?>
  191. <?php if ($this->params->get('show_author')) : ?>
  192. <td >
  193. <?php echo $this->escape($item->created_by_alias) ? $this->escape($item->created_by_alias) : $this->escape($item->author); ?>
  194. </td>
  195. <?php endif; ?>
  196. <?php if ($this->params->get('show_hits')) : ?>
  197. <td align="center">
  198. <?php echo $this->escape($item->hits) ? $this->escape($item->hits) : '-'; ?>
  199. </td>
  200. <?php endif; ?>
  201. </tr>
  202. <?php endif; ?>
  203. <?php endforeach; ?>
  204. <?php if (count($this->items) %2) : ?>
  205. <tr class="sectiontableentry<?php echo ($item->odd +1 ) . $this->escape($this->params->get('pageclass_sfx')); ?>" ><td colspan=10>&nbsp;</td></tr>
  206. <?php endif; ?>
  207. </table>
  208. </td></tr></table>
  209.  
  210. <table width=100%>
  211. <?php if ($this->params->get('show_pagination')) : ?>
  212. <tr>
  213. <td colspan="5">&nbsp;</td>
  214. </tr>
  215. <tr>
  216. <td align="center" colspan="4" class="sectiontablefooter<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  217. <?php echo $this->pagination->getPagesLinks(); ?>
  218. </td>
  219. </tr>
  220. <tr>
  221. <td colspan="5" align="right">
  222. <?php echo $this->pagination->getPagesCounter(); ?>
  223. </td>
  224. <?php endif; ?>
  225. </tr>
  226.  
  227. </table>
  228.  
  229. <input type="hidden" name="id" value="<?php echo $this->category->id; ?>" />
  230. <input type="hidden" name="sectionid" value="<?php echo $this->category->sectionid; ?>" />
  231. <input type="hidden" name="task" value="<?php echo $this->lists['task']; ?>" />
  232. <input type="hidden" name="filter_order" value="" />
  233. <input type="hidden" name="filter_order_Dir" value="" />
  234. <input type="hidden" name="limitstart" value="0" />
  235. <input type="hidden" name="viewcache" value="0" />
  236. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement