PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/components/com_content/views/featured/tmpl/default_item.php

https://github.com/3den/J-MediaGalleries
PHP | 150 lines | 128 code | 13 blank | 9 comment | 35 complexity | 8b0f50371814e551d1ec6c687fa8f3a9 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: default_item.php 19024 2010-10-02 18:53:34Z 3dentech $
  4. * @package Joomla.Site
  5. * @subpackage com_content
  6. * @copyright Copyright (C) 2005 - 2010 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->user->authorise('core.edit', 'com_content.frontpage.'.$this->item->id);
  14. ?>
  15. <?php if ($this->item->state == 0) : ?>
  16. <div class="system-unpublished">
  17. <?php endif; ?>
  18. <?php if ($params->get('show_title')) : ?>
  19. <h2>
  20. <?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
  21. <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
  22. <?php echo $this->escape($this->item->title); ?></a>
  23. <?php else : ?>
  24. <?php echo $this->escape($this->item->title); ?>
  25. <?php endif; ?>
  26. </h2>
  27. <?php endif; ?>
  28. <?php if ($params->get('show_print_icon') || $params->get('show_email_icon') || $canEdit) : ?>
  29. <ul class="actions">
  30. <?php if ($params->get('show_print_icon')) : ?>
  31. <li class="print-icon">
  32. <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?>
  33. </li>
  34. <?php endif; ?>
  35. <?php if ($params->get('show_email_icon')) : ?>
  36. <li class="email-icon">
  37. <?php echo JHtml::_('icon.email', $this->item, $params); ?>
  38. </li>
  39. <?php endif; ?>
  40. <?php if ($canEdit) : ?>
  41. <li class="edit-icon">
  42. <?php echo JHtml::_('icon.edit', $this->item, $params); ?>
  43. </li>
  44. <?php endif; ?>
  45. </ul>
  46. <?php endif; ?>
  47. <?php if (!$params->get('show_intro')) : ?>
  48. <?php echo $this->item->event->afterDisplayTitle; ?>
  49. <?php endif; ?>
  50. <?php echo $this->item->event->beforeDisplayContent; ?>
  51. <?php // to do not that elegant would be nice to group the params ?>
  52. <?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'))) : ?>
  53. <dl class="article-info">
  54. <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
  55. <?php endif; ?>
  56. <?php if ($params->get('show_parent_category')) : ?>
  57. <dd class="parent-category-name">
  58. <?php $title = $this->escape($this->item->parent_title);
  59. $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)) . '">' . $title . '</a>'; ?>
  60. <?php if ($params->get('link_parent_category') AND $this->item->parent_slug) : ?>
  61. <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
  62. <?php else : ?>
  63. <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
  64. <?php endif; ?>
  65. </dd>
  66. <?php endif; ?>
  67. <?php if ($params->get('show_category')) : ?>
  68. <dd class="category-name">
  69. <?php $title = $this->escape($this->item->category_title);
  70. $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
  71. <?php if ($params->get('link_category') AND $this->item->catslug) : ?>
  72. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
  73. <?php else : ?>
  74. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
  75. <?php endif; ?>
  76. </dd>
  77. <?php endif; ?>
  78. <?php if ($params->get('show_create_date')) : ?>
  79. <dd class="create">
  80. <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHTML::_('date',$this->item->created, JText::_('DATE_FORMAT_LC2'))); ?>
  81. </dd>
  82. <?php endif; ?>
  83. <?php if ($params->get('show_modify_date')) : ?>
  84. <dd class="modified">
  85. <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHTML::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
  86. </dd>
  87. <?php endif; ?>
  88. <?php if ($params->get('show_publish_date')) : ?>
  89. <dd class="published">
  90. <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHTML::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?>
  91. </dd>
  92. <?php endif; ?>
  93. <?php if ($params->get('show_author') && !empty($this->item->author)) : ?>
  94. <dd class="createdby">
  95. <?php $author = $params->get('link_author', 0) ? JHTML::_('link',JRoute::_('index.php?option=com_users&view=profile&member_id='.$this->item->created_by),$this->item->author) : $this->item->author; ?>
  96. <?php $author=($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>
  97. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
  98. </dd>
  99. <?php endif; ?>
  100. <?php if ($params->get('show_hits')) : ?>
  101. <dd class="hits">
  102. <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
  103. </dd>
  104. <?php endif; ?>
  105. <?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'))) : ?>
  106. </dl>
  107. <?php endif; ?>
  108. <?php echo $this->item->introtext; ?>
  109. <?php if ($params->get('show_readmore') && $this->item->readmore) :
  110. if ($params->get('access-view')) :
  111. $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
  112. else :
  113. $menu = JFactory::getApplication()->getMenu();
  114. $active = $menu->getActive();
  115. $itemId = $active->id;
  116. $link1 = JRoute::_('index.php?option=com_users&view=login&&Itemid=' . $itemId);
  117. $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
  118. $link = new JURI($link1);
  119. $link->setVar('return', base64_encode($returnURL));
  120. endif;
  121. ?>
  122. <p class="readmore">
  123. <a href="<?php echo $link; ?>">
  124. <?php if (!$params->get('access-view')) :
  125. echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
  126. elseif ($readmore = $this->item->alternative_readmore) :
  127. echo $readmore;
  128. else :
  129. echo JText::sprintf('COM_CONTENT_READ_MORE', $this->escape($this->item->title));
  130. endif; ?></a>
  131. </p>
  132. <?php endif; ?>
  133. <?php if ($this->item->state == 0) : ?>
  134. </div>
  135. <?php endif; ?>
  136. <div class="item-separator"></div>
  137. <?php echo $this->item->event->afterDisplayContent; ?>