/html/com_content/category/blog.php

https://github.com/losaposta/ubuntuism · PHP · 202 lines · 164 code · 29 blank · 9 comment · 52 complexity · ba4910cf80e9441098911ddb249d050d MD5 · raw file

  1. <?php defined('_JEXEC') or die;
  2. /**
  3. * @package Unified HTML5 Template Framework for Joomla!
  4. * @author Cristina Solana http://nightshiftcreative.com
  5. * @author Matt Thomas http://construct-framework.com | http://betweenbrain.com
  6. * @copyright Copyright (C) 2009 - 2011 Matt Thomas. All rights reserved.
  7. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
  8. */
  9. if (substr(JVERSION, 0, 3) >= '1.6') {
  10. // Joomla! 1.6+
  11. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); ?>
  12. <section class="blog<?php echo $this->pageclass_sfx;?>">
  13. <?php if ($this->params->get('show_page_heading', 1)) : ?>
  14. <hgroup>
  15. <h1>
  16. <?php echo $this->escape($this->params->get('page_heading')); ?>
  17. </h1>
  18. <?php endif; ?>
  19. <?php if ($this->params->get('show_category_title', 1) OR $this->params->get('page_subheading')) : ?>
  20. <h2>
  21. <?php echo $this->escape($this->params->get('page_subheading')); ?>
  22. <?php if ($this->params->get('show_category_title')) : ?>
  23. <span class="subheading-category"><?php echo $this->category->title;?></span>
  24. <?php endif; ?>
  25. </h2>
  26. </hgroup>
  27. <?php endif; ?>
  28. <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
  29. <section class="category-desc clearfix">
  30. <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
  31. <img src="<?php echo $this->category->getParams()->get('image'); ?>"/>
  32. <?php endif; ?>
  33. <?php if ($this->params->get('show_description') && $this->category->description) : ?>
  34. <?php echo JHtml::_('content.prepare', $this->category->description); ?>
  35. <?php endif; ?>
  36. </section>
  37. <?php endif; ?>
  38. <?php $leadingcount=0 ; ?>
  39. <?php if (!empty($this->lead_items)) : ?>
  40. <section class="items-leading">
  41. <?php foreach ($this->lead_items as &$item) : ?>
  42. <article class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">
  43. <?php
  44. $this->item = &$item;
  45. echo $this->loadTemplate('item');
  46. ?>
  47. </article>
  48. <?php
  49. $leadingcount++;
  50. ?>
  51. <?php endforeach; ?>
  52. </section>
  53. <?php endif; ?>
  54. <?php
  55. $introcount=(count($this->intro_items));
  56. $counter=0;
  57. ?>
  58. <?php if (!empty($this->intro_items)) : ?>
  59. <section class="items-intro">
  60. <?php foreach ($this->intro_items as $key => &$item) : ?>
  61. <?php
  62. $key= ($key-$leadingcount)+1;
  63. $rowcount=( ((int)$key-1) % (int) $this->columns) +1;
  64. $row = $counter / $this->columns ;
  65. if ($rowcount==1) : ?>
  66. <div class="items-row cols-<?php echo (int) $this->columns;?> <?php echo 'row-'.$row ; ?> clearfix">
  67. <?php endif; ?>
  68. <article class="item column-<?php echo $rowcount;?><?php echo $item->state == 0 ? ' system-unpublished"' : null; ?>">
  69. <?php
  70. $this->item = &$item;
  71. echo $this->loadTemplate('item');
  72. ?>
  73. </article>
  74. <?php $counter++; ?>
  75. <?php if (($rowcount == $this->columns) or ($counter ==$introcount)): ?>
  76. </div>
  77. <?php endif; ?>
  78. <?php endforeach; ?>
  79. </section>
  80. <?php endif; ?>
  81. <?php if (!empty($this->link_items)) : ?>
  82. <?php echo $this->loadTemplate('links'); ?>
  83. <?php endif; ?>
  84. <?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?>
  85. <section class="cat-children">
  86. <h3>
  87. <?php echo JTEXT::_('JGLOBAL_SUBCATEGORIES'); ?>
  88. </h3>
  89. <?php echo $this->loadTemplate('children'); ?>
  90. </section>
  91. <?php endif; ?>
  92. <?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
  93. <nav class="pagination">
  94. <?php if ($this->params->def('show_pagination_results', 1)) : ?>
  95. <p class="counter">
  96. <?php echo $this->pagination->getPagesCounter(); ?>
  97. </p>
  98. <?php endif; ?>
  99. <?php echo $this->pagination->getPagesLinks(); ?>
  100. </nav>
  101. <?php endif; ?>
  102. </section>
  103. <?php
  104. }
  105. else {
  106. // Joomla! 1.5 Output
  107. $cparams = JComponentHelper::getParams ('com_media');
  108. ?>
  109. <section class="blog<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
  110. <?php if ($this->params->get('show_page_title')) : ?>
  111. <h1>
  112. <?php echo $this->escape($this->params->get('page_title')); ?>
  113. </h1>
  114. <?php endif; ?>
  115. <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
  116. <p class="category-desc">
  117. <?php if ($this->params->get('show_description_image') && $this->category->image) : ?>
  118. <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/' . $this->category->image; ?>" class="image_<?php echo $this->category->image_position; ?>" />
  119. <?php endif; ?>
  120. <?php if ($this->params->get('show_description') && $this->category->description) : ?>
  121. <?php echo $this->category->description; ?>
  122. <?php endif; ?>
  123. </p>
  124. <?php endif; ?>
  125. <?php
  126. $i = $this->pagination->limitstart;
  127. $rowcount = $this->params->def('num_leading_articles', 1);?>
  128. <section class="items-leading">
  129. <?php for ($y = 0; $y < $rowcount && $i < $this->total; $y++, $i++) : ?>
  130. <article class="leading-<?php echo $y ;?>">
  131. <?php $this->item =& $this->getItem($i, $this->params);
  132. echo $this->loadTemplate('item'); ?>
  133. </article>
  134. <?php endfor; ?>
  135. </section>
  136. <?php $introcount = $this->params->def('num_intro_articles', 4);
  137. if ($introcount) :
  138. $colcount = (int)$this->params->def('num_columns', 2);
  139. if ($colcount == 0) :
  140. $colcount = 1;
  141. endif;
  142. $rowcount = (int) $introcount / $colcount;
  143. $ii = 0;?>
  144. <section class="items-intro">
  145. <?php for ($y = 0; $y < $rowcount && $i < $this->total; $y++) : ?>
  146. <div class="items-row cols-<?php echo $colcount; ?> row-<?php echo $y; ?> clearfix">
  147. <?php for ($z = 0; $z < $colcount && $ii < $introcount && $i < $this->total; $z++, $i++, $ii++) : ?>
  148. <article class="item column-<?php echo $z + 1; ?>">
  149. <?php $this->item =& $this->getItem($i, $this->params);
  150. echo $this->loadTemplate('item'); ?>
  151. </article>
  152. <?php endfor; ?>
  153. </div>
  154. <?php endfor;?>
  155. </section>
  156. <?php endif; ?>
  157. <?php $numlinks = $this->params->def('num_links', 4);
  158. if ($numlinks && $i < $this->total) : ?>
  159. <?php $this->links = array_slice($this->items, $i - $this->pagination->limitstart, $i - $this->pagination->limitstart + $numlinks);
  160. echo $this->loadTemplate('links'); ?>
  161. <?php endif; ?>
  162. <?php if ($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->get('pages.total') > 1)) : ?>
  163. <nav class="pagination">
  164. <?php if ($this->params->def('show_pagination_results', 1)) : ?>
  165. <p class="counter">
  166. <?php echo $this->pagination->getPagesCounter(); ?>
  167. </p>
  168. <?php endif; ?>
  169. <?php echo $this->pagination->getPagesLinks(); ?>
  170. </nav>
  171. <?php endif; ?>
  172. </section>
  173. <?php }