/www/components/com_k2/templates/webstar/category.php

https://github.com/amet17/webstar · PHP · 262 lines · 203 code · 42 blank · 17 comment · 61 complexity · 505af7cf6c1d5362f061fff55e925365 MD5 · raw file

  1. <?php
  2. /**
  3. * @version $Id: category.php 569 2010-09-23 12:50:28Z joomlaworks $
  4. * @package K2
  5. * @author JoomlaWorks http://www.joomlaworks.gr
  6. * @copyright Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved.
  7. * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
  8. */
  9. // no direct access
  10. defined('_JEXEC') or die('Restricted access');
  11. ?>
  12. <!-- Start K2 Category Layout -->
  13. <div id="k2Container" class="itemListView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">
  14. <?php if($this->params->get('show_page_title')): ?>
  15. <!-- Page title -->
  16. <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
  17. <h1 class="k2-category-heading"><?php echo $this->escape($this->params->get('page_title')); ?></h1>
  18. </div>
  19. <?php endif; ?>
  20. <?php if($this->params->get('catFeedLink')): ?>
  21. <!-- RSS feed icon -->
  22. <div class="k2FeedIcon">
  23. <a href="<?php echo $this->feed; ?>" title="<?php echo JText::_('Subscribe to this RSS feed'); ?>">
  24. <span><?php echo JText::_('Subscribe to this RSS feed'); ?></span>
  25. </a>
  26. <div class="clr"></div>
  27. </div>
  28. <?php endif; ?>
  29. <?php if(isset($this->category) || ( $this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories) )): ?>
  30. <!-- Blocks for current category and subcategories -->
  31. <div class="itemListCategoriesBlock">
  32. <?php if(isset($this->category) && ( $this->params->get('catImage') || $this->params->get('catTitle') || $this->params->get('catDescription') || $this->category->event->K2CategoryDisplay )): ?>
  33. <!-- Category block -->
  34. <div class="itemListCategory">
  35. <?php if(isset($this->addLink)): ?>
  36. <!-- Item add link -->
  37. <span class="catItemAddLink">
  38. <a class="modal" rel="{handler:'iframe',size:{x:990,y:650}}" href="<?php echo $this->addLink; ?>">
  39. <?php echo JText::_('Add a new item in this category'); ?>
  40. </a>
  41. </span>
  42. <?php endif; ?>
  43. <?php if($this->params->get('catImage') && $this->category->image): ?>
  44. <!-- Category image -->
  45. <img alt="<?php echo $this->category->name; ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />
  46. <?php endif; ?>
  47. <?php if($this->params->get('catTitle')): ?>
  48. <!-- Category title -->
  49. <h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2>
  50. <?php endif; ?>
  51. <?php if($this->params->get('catDescription')): ?>
  52. <!-- Category description -->
  53. <p><?php echo $this->category->description; ?></p>
  54. <?php endif; ?>
  55. <!-- K2 Plugins: K2CategoryDisplay -->
  56. <?php echo $this->category->event->K2CategoryDisplay; ?>
  57. <div class="clr"></div>
  58. </div>
  59. <?php endif; ?>
  60. <?php if($this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories)): ?>
  61. <!-- Subcategories -->
  62. <div class="itemListSubCategories">
  63. <!-- <h3><?php echo JText::_('Children categories'); ?></h3> -->
  64. <?php foreach($this->subCategories as $key=>$subCategory): ?>
  65. <?php
  66. // Define a CSS class for the last container on each row
  67. if( (($key+1)%($this->params->get('subCatColumns'))==0) || count($this->subCategories)<$this->params->get('subCatColumns') )
  68. $lastContainer= ' subCategoryContainerLast';
  69. else
  70. $lastContainer='';
  71. ?>
  72. <div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
  73. <div class="subCategory">
  74. <?php if($this->params->get('subCatImage') && $subCategory->image): ?>
  75. <!-- Subcategory image -->
  76. <a class="subCategoryImage" href="<?php echo $subCategory->link; ?>">
  77. <img alt="<?php echo $subCategory->name; ?>" src="<?php echo $subCategory->image; ?>" />
  78. </a>
  79. <?php endif; ?>
  80. <?php if($this->params->get('subCatTitle')): ?>
  81. <!-- Subcategory title -->
  82. <h2><?php echo $subCategory->name; ?><?php if($this->params->get('subCatTitleItemCounter')) echo ' ('.$subCategory->numOfItems.')'; ?></h2>
  83. <?php endif; ?>
  84. <?php if($this->params->get('subCatDescription')): ?>
  85. <!-- Subcategory description -->
  86. <p><?php echo $subCategory->description; ?></p>
  87. <?php endif; ?>
  88. <?php if($this->params->get('subCatMore')): ?>
  89. <!-- Subcategory more... -->
  90. <a class="subCategoryMore" href="<?php echo $subCategory->link; ?>">
  91. <?php echo JText::_('View items...'); ?>
  92. </a>
  93. <?php endif; ?>
  94. <div class="clr"></div>
  95. </div>
  96. </div>
  97. <?php if(($key+1)%($this->params->get('subCatColumns'))==0): ?>
  98. <div class="clr"></div>
  99. <?php endif; ?>
  100. <?php endforeach; ?>
  101. <div class="clr"></div>
  102. </div>
  103. <?php endif; ?>
  104. </div>
  105. <?php endif; ?>
  106. <?php if((isset($this->leading) || isset($this->primary) || isset($this->secondary) || isset($this->links)) && (count($this->leading) || count($this->primary) || count($this->secondary) || count($this->links))): ?>
  107. <!-- Item list -->
  108. <div class="itemList">
  109. <?php if(isset($this->leading) && count($this->leading)): ?>
  110. <!-- Leading items -->
  111. <div id="itemListLeading">
  112. <?php foreach($this->leading as $key=>$item): ?>
  113. <?php
  114. // Define a CSS class for the last container on each row
  115. if( (($key+1)%($this->params->get('num_leading_columns'))==0) || count($this->leading)<$this->params->get('num_leading_columns') )
  116. $lastContainer= ' itemContainerLast';
  117. else
  118. $lastContainer='';
  119. ?>
  120. <div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->leading)==1) ? '' : ' style="width:'.number_format(99/$this->params->get('num_leading_columns'), 1).'%;"'; ?>>
  121. <?php
  122. // Load category_item.php by default
  123. $this->item=$item;
  124. echo $this->loadTemplate('item');
  125. ?>
  126. </div>
  127. <?php if(($key+1)%($this->params->get('num_leading_columns'))==0): ?>
  128. <div class="clr"></div>
  129. <?php endif; ?>
  130. <?php endforeach; ?>
  131. <div class="clr"></div>
  132. </div>
  133. <?php endif; ?>
  134. <?php if(isset($this->primary) && count($this->primary)): ?>
  135. <!-- Primary items -->
  136. <div id="itemListPrimary">
  137. <?php foreach($this->primary as $key=>$item): ?>
  138. <?php
  139. // Define a CSS class for the last container on each row
  140. if( (($key+1)%($this->params->get('num_primary_columns'))==0) || count($this->primary)<$this->params->get('num_primary_columns') )
  141. $lastContainer= ' itemContainerLast';
  142. else
  143. $lastContainer='';
  144. ?>
  145. <div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->primary)==1) ? '' : ' style="width:'.number_format(99/$this->params->get('num_primary_columns'), 1).'%;"'; ?>>
  146. <?php
  147. // Load category_item.php by default
  148. $this->item=$item;
  149. echo $this->loadTemplate('item');
  150. ?>
  151. </div>
  152. <?php if(($key+1)%($this->params->get('num_primary_columns'))==0): ?>
  153. <div class="clr"></div>
  154. <?php endif; ?>
  155. <?php endforeach; ?>
  156. <div class="clr"></div>
  157. </div>
  158. <?php endif; ?>
  159. <?php if(isset($this->secondary) && count($this->secondary)): ?>
  160. <!-- Secondary items -->
  161. <div id="itemListSecondary">
  162. <?php foreach($this->secondary as $key=>$item): ?>
  163. <?php
  164. // Define a CSS class for the last container on each row
  165. if( (($key+1)%($this->params->get('num_secondary_columns'))==0) || count($this->secondary)<$this->params->get('num_secondary_columns') )
  166. $lastContainer= ' itemContainerLast';
  167. else
  168. $lastContainer='';
  169. ?>
  170. <div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->secondary)==1) ? '' : ' style="width:'.number_format(99/$this->params->get('num_secondary_columns'), 1).'%;"'; ?>>
  171. <?php
  172. // Load category_item.php by default
  173. $this->item=$item;
  174. echo $this->loadTemplate('item');
  175. ?>
  176. </div>
  177. <?php if(($key+1)%($this->params->get('num_secondary_columns'))==0): ?>
  178. <div class="clr"></div>
  179. <?php endif; ?>
  180. <?php endforeach; ?>
  181. <div class="clr"></div>
  182. </div>
  183. <?php endif; ?>
  184. <?php if(isset($this->links) && count($this->links)): ?>
  185. <!-- Link items -->
  186. <div id="itemListLinks">
  187. <p><?php echo JText::_('More...'); ?></p>
  188. <?php foreach($this->links as $key=>$item): ?>
  189. <?php
  190. // Define a CSS class for the last container on each row
  191. if( (($key+1)%($this->params->get('num_links_columns'))==0) || count($this->links)<$this->params->get('num_links_columns') )
  192. $lastContainer= ' itemContainerLast';
  193. else
  194. $lastContainer='';
  195. ?>
  196. <div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->links)==1) ? '' : ' style="width:'.number_format(99/$this->params->get('num_links_columns'), 1).'%;"'; ?>>
  197. <?php
  198. // Load category_item_links.php by default
  199. $this->item=$item;
  200. echo $this->loadTemplate('item_links');
  201. ?>
  202. </div>
  203. <?php if(($key+1)%($this->params->get('num_links_columns'))==0): ?>
  204. <div class="clr"></div>
  205. <?php endif; ?>
  206. <?php endforeach; ?>
  207. <div class="clr"></div>
  208. </div>
  209. <?php endif; ?>
  210. </div>
  211. <!-- Pagination -->
  212. <?php if(count($this->pagination->getPagesLinks())): ?>
  213. <div id="system">
  214. <?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
  215. <div class="clr"></div>
  216. </div>
  217. <?php endif; ?>
  218. <?php endif; ?>
  219. </div>
  220. <!-- End K2 Category Layout -->