PageRenderTime 49ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/tmp/install_4d95e3a8cdfe7/GreenDreamJ16/html/com_content/category/blog_item.php

https://github.com/spn87/101
PHP | 167 lines | 139 code | 19 blank | 9 comment | 42 complexity | f77b63159dc8c209eab457ce0c0852ff MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: blog_item.php 20196 2011-01-09 02:40:25Z ian $
  4. * @package Joomla.Site
  5. * @subpackage com_content
  6. * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. // no direct access
  10. defined('_JEXEC') or die;
  11. // Create a shortcut for params.
  12. $params = &$this->item->params;
  13. $canEdit = $this->item->params->get('access-edit');
  14. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  15. JHtml::_('behavior.tooltip');
  16. JHtml::core();
  17. ?>
  18. <?php if ($this->item->state == 0) : ?>
  19. <div class="system-unpublished">
  20. <?php endif; ?>
  21. <?php if ($params->get('show_title')) : ?>
  22. <h2 class="item-page-title<?php echo $this->pageclass_sfx?>">
  23. <?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
  24. <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
  25. <?php echo $this->escape($this->item->title); ?></a>
  26. <?php else : ?>
  27. <?php echo $this->escape($this->item->title); ?>
  28. <?php endif; ?>
  29. </h2>
  30. <?php endif; ?>
  31. <?php if ($params->get('show_print_icon') || $params->get('show_email_icon') || $canEdit) : ?>
  32. <div class="buttonheading">
  33. <?php if ($params->get('show_print_icon')) : ?>
  34. <div class="print">
  35. <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?>
  36. </div>
  37. <?php endif; ?>
  38. <?php if ($params->get('show_email_icon')) : ?>
  39. <div class="email">
  40. <?php echo JHtml::_('icon.email', $this->item, $params); ?>
  41. </div>
  42. <?php endif; ?>
  43. <?php if ($canEdit) : ?>
  44. <div class="edit">
  45. <?php echo JHtml::_('icon.edit', $this->item, $params); ?>
  46. </div>
  47. <?php endif; ?>
  48. </div>
  49. <?php endif; ?>
  50. <?php if (!$params->get('show_intro')) : ?>
  51. <?php echo $this->item->event->afterDisplayTitle; ?>
  52. <?php endif; ?>
  53. <?php echo $this->item->event->beforeDisplayContent; ?>
  54. <?php // to do not that elegant would be nice to group the params ?>
  55. <?php $useDefList = (($params->get('show_author')) OR ($params->get('show_category')) OR ($params->get('show_parent_category'))
  56. OR ($params->get('show_create_date')) OR ($params->get('show_modify_date')) OR ($params->get('show_publish_date'))); ?>
  57. <?php if ($useDefList) : ?>
  58. <div class="iteminfo">
  59. <?php endif; ?>
  60. <?php if ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') : ?>
  61. <span class="category">
  62. <?php $title = $this->escape($this->item->parent_title);
  63. $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?>
  64. <?php if ($params->get('link_parent_category') AND $this->item->parent_slug) : ?>
  65. <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
  66. <?php else : ?>
  67. <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
  68. <?php endif; ?>
  69. </span>
  70. <?php endif; ?>
  71. <?php if ($params->get('show_category')) : ?>
  72. <span class="sub-category">
  73. <?php $title = $this->escape($this->item->category_title);
  74. $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
  75. <?php if ($params->get('link_category') AND $this->item->catslug) : ?>
  76. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
  77. <?php else : ?>
  78. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
  79. <?php endif; ?>
  80. </span>
  81. <?php endif; ?>
  82. <?php if ($useDefList) : ?>
  83. <div class="clr"></div>
  84. <?php endif; ?>
  85. <?php if ($params->get('show_create_date')) : ?>
  86. <span class="create">
  87. <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHTML::_('date',$this->item->created, JText::_('DATE_FORMAT_LC1'))); ?>
  88. </span>
  89. <?php endif; ?>
  90. <?php if ($params->get('show_modify_date')) : ?>
  91. <span class="modified">
  92. <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHTML::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC1'))); ?>
  93. </span>
  94. <?php endif; ?>
  95. <?php if ($params->get('show_publish_date')) : ?>
  96. <span class="published">
  97. <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHTML::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC1'))); ?>
  98. </span>
  99. <?php endif; ?>
  100. <?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
  101. <span class="createdby">
  102. <?php $author = $this->item->author; ?>
  103. <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
  104. <?php if (!empty($this->item->contactid ) && $params->get('link_author') == true):?>
  105. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY' ,
  106. JHTML::_('link',JRoute::_('index.php?option=com_contact&view=contact&id='.$this->item->contactid),$author)); ?>
  107. <?php else :?>
  108. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
  109. <?php endif; ?>
  110. </span>
  111. <?php endif; ?>
  112. <?php if ($useDefList) : ?>
  113. </div>
  114. <?php endif; ?>
  115. <?php echo $this->item->introtext; ?>
  116. <?php if ($params->get('show_readmore') && $this->item->readmore) :
  117. if ($params->get('access-view')) :
  118. $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
  119. else :
  120. $menu = JFactory::getApplication()->getMenu();
  121. $active = $menu->getActive();
  122. $itemId = $active->id;
  123. $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
  124. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug));
  125. $link = new JURI($link1);
  126. $link->setVar('return', base64_encode($returnURL));
  127. endif;
  128. ?>
  129. <p class="readmore">
  130. <a href="<?php echo $link; ?>">
  131. <?php if (!$params->get('access-view')) :
  132. echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
  133. elseif ($readmore = $this->item->alternative_readmore) :
  134. echo $readmore;
  135. echo JHTML::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  136. elseif ($params->get('show_readmore_title', 0) == 0) :
  137. echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
  138. else :
  139. echo JText::_('COM_CONTENT_READ_MORE');
  140. echo JHTML::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  141. endif; ?></a>
  142. </p>
  143. <?php endif; ?>
  144. <?php if ($this->item->state == 0) : ?>
  145. </div>
  146. <?php endif; ?>
  147. <div class="item-separator"></div>
  148. <?php echo $this->item->event->afterDisplayContent; ?>