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

/joomla/plugins/system/gantry/overrides/3.2/2.5/com_content/category/blog_item.php

https://gitlab.com/ricardosanchez/prueba
PHP | 172 lines | 153 code | 12 blank | 7 comment | 54 complexity | 13791f10cc48ee922fa9f74786ac47d7 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Site
  4. * @subpackage Templates.beez3
  5. *
  6. * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. $params =& $this->item->params;
  11. $images = json_decode($this->item->images);
  12. $app = JFactory::getApplication();
  13. $canEdit = $this->item->params->get('access-edit');
  14. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
  15. ?>
  16. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
  17. || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != '0000-00-00 00:00:00' )) : ?>
  18. <div class="system-unpublished">
  19. <?php endif; ?>
  20. <?php if ($params->get('show_title')) : ?>
  21. <h2>
  22. <?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
  23. <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
  24. <?php echo $this->escape($this->item->title); ?></a>
  25. <?php else : ?>
  26. <?php echo $this->escape($this->item->title); ?>
  27. <?php endif; ?>
  28. </h2>
  29. <?php endif; ?>
  30. <?php if ($params->get('show_print_icon') || $params->get('show_email_icon') || $canEdit) : ?>
  31. <ul class="actions">
  32. <?php if ($params->get('show_print_icon')) : ?>
  33. <li class="print-icon">
  34. <?php echo JHtml::_('icon.print_popup', $this->item, $params, array(), true); ?>
  35. </li>
  36. <?php endif; ?>
  37. <?php if ($params->get('show_email_icon')) : ?>
  38. <li class="email-icon">
  39. <?php echo JHtml::_('icon.email', $this->item, $params, array(), true); ?>
  40. </li>
  41. <?php endif; ?>
  42. <?php if ($canEdit) : ?>
  43. <li class="edit-icon">
  44. <?php echo JHtml::_('icon.edit', $this->item, $params, array(), true); ?>
  45. </li>
  46. <?php endif; ?>
  47. </ul>
  48. <?php endif; ?>
  49. <?php if (!$params->get('show_intro')) : ?>
  50. <?php echo $this->item->event->afterDisplayTitle; ?>
  51. <?php endif; ?>
  52. <?php echo $this->item->event->beforeDisplayContent; ?>
  53. <?php // to do not that elegant would be nice to group the params ?>
  54. <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) : ?>
  55. <dl class="article-info">
  56. <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
  57. <?php endif; ?>
  58. <?php if ($params->get('show_parent_category') && $this->item->parent_id != 1) : ?>
  59. <dd class="parent-category-name">
  60. <?php $title = $this->escape($this->item->parent_title);
  61. $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_id)) . '">' . $title . '</a>'; ?>
  62. <?php if ($params->get('link_parent_category')) : ?>
  63. <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
  64. <?php else : ?>
  65. <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
  66. <?php endif; ?>
  67. </dd>
  68. <?php endif; ?>
  69. <?php if ($params->get('show_category')) : ?>
  70. <dd class="category-name">
  71. <?php $title = $this->escape($this->item->category_title);
  72. $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) . '">' . $title . '</a>'; ?>
  73. <?php if ($params->get('link_category')) : ?>
  74. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
  75. <?php else : ?>
  76. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
  77. <?php endif; ?>
  78. </dd>
  79. <?php endif; ?>
  80. <?php if ($params->get('show_create_date')) : ?>
  81. <dd class="create">
  82. <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?>
  83. </dd>
  84. <?php endif; ?>
  85. <?php if ($params->get('show_modify_date')) : ?>
  86. <dd class="modified">
  87. <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
  88. </dd>
  89. <?php endif; ?>
  90. <?php if ($params->get('show_publish_date')) : ?>
  91. <dd class="published">
  92. <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?>
  93. </dd>
  94. <?php endif; ?>
  95. <?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
  96. <dd class="createdby">
  97. <?php $author = $this->item->author; ?>
  98. <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
  99. <?php if (!empty($this->item->contact_link ) && $params->get('link_author') == true) : ?>
  100. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author)); ?>
  101. <?php else :?>
  102. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
  103. <?php endif; ?>
  104. </dd>
  105. <?php endif; ?>
  106. <?php if ($params->get('show_hits')) : ?>
  107. <dd class="hits">
  108. <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
  109. </dd>
  110. <?php endif; ?>
  111. <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) :?>
  112. </dl>
  113. <?php endif; ?>
  114. <?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
  115. <?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
  116. <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>">
  117. <img
  118. <?php if ($images->image_intro_caption):
  119. echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
  120. endif; ?>
  121. src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
  122. </div>
  123. <?php endif; ?>
  124. <?php echo $this->item->introtext; ?>
  125. <?php if ($params->get('show_readmore') && $this->item->readmore) :
  126. if ($params->get('access-view')) :
  127. $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
  128. else :
  129. $menu = JFactory::getApplication()->getMenu();
  130. $active = $menu->getActive();
  131. $itemId = $active->id;
  132. $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
  133. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug));
  134. $link = new JUri($link1);
  135. $link->setVar('return', base64_encode($returnURL));
  136. endif;
  137. ?>
  138. <p class="readmore">
  139. <a href="<?php echo $link; ?>">
  140. <?php if (!$params->get('access-view')) :
  141. echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
  142. elseif ($readmore = $this->item->alternative_readmore) :
  143. echo $readmore;
  144. if ($params->get('show_readmore_title', 0) != 0) :
  145. echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  146. endif;
  147. elseif ($params->get('show_readmore_title', 0) == 0) :
  148. echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
  149. else :
  150. echo JText::_('COM_CONTENT_READ_MORE');
  151. echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  152. endif; ?></a>
  153. </p>
  154. <?php endif; ?>
  155. <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
  156. || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != '0000-00-00 00:00:00' )) : ?>
  157. </div>
  158. <?php endif; ?>
  159. <div class="item-separator"></div>
  160. <?php echo $this->item->event->afterDisplayContent; ?>