Guest User

Untitled

a guest
Dec 11th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.63 KB | None | 0 0
  1. <?php
  2. /**
  3. * @version $Id: default.php 21518 2011-06-10 21:38:12Z chdemko $
  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.  
  10. // no direct access
  11. defined('_JEXEC') or die;
  12.  
  13. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
  14.  
  15. // Create shortcuts to some parameters.
  16. $params = $this->item->params;
  17. $canEdit = $this->item->params->get('access-edit');
  18. $user = JFactory::getUser();
  19. ?>
  20. <div class="item-page<?php echo $this->pageclass_sfx?>">
  21. <?php if ($this->params->get('show_page_heading', 1)) : ?>
  22. <h1>
  23. <?php echo $this->escape($this->params->get('page_heading')); ?>
  24. </h1>
  25. <?php endif; ?>
  26. <?php if ($params->get('show_title')) : ?>
  27. <h2>
  28. <?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
  29. <a href="<?php echo $this->item->readmore_link; ?>">
  30. <?php echo $this->escape($this->item->title); ?></a>
  31. <?php else : ?>
  32. <?php echo $this->escape($this->item->title); ?>
  33. <?php endif; ?>
  34. </h2>
  35. <?php endif; ?>
  36.  
  37. <?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
  38. <ul class="actions">
  39. <?php if (!$this->print) : ?>
  40. <?php if ($params->get('show_print_icon')) : ?>
  41. <li class="print-icon">
  42. <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?>
  43. </li>
  44. <?php endif; ?>
  45.  
  46. <?php if ($params->get('show_email_icon')) : ?>
  47. <li class="email-icon">
  48. <?php echo JHtml::_('icon.email', $this->item, $params); ?>
  49. </li>
  50. <?php endif; ?>
  51.  
  52. <?php if ($canEdit) : ?>
  53. <li class="edit-icon">
  54. <?php echo JHtml::_('icon.edit', $this->item, $params); ?>
  55. </li>
  56. <?php endif; ?>
  57.  
  58. <?php else : ?>
  59. <li>
  60. <?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
  61. </li>
  62. <?php endif; ?>
  63.  
  64. </ul>
  65. <?php endif; ?>
  66.  
  67. <?php if (!$params->get('show_intro')) :
  68. echo $this->item->event->afterDisplayTitle;
  69. endif; ?>
  70.  
  71. <?php echo $this->item->event->beforeDisplayContent; ?>
  72.  
  73. <?php $useDefList = (($params->get('show_author')) OR ($params->get('show_category')) OR ($params->get('show_parent_category'))
  74. OR ($params->get('show_create_date')) OR ($params->get('show_modify_date')) OR ($params->get('show_publish_date'))
  75. OR ($params->get('show_hits'))); ?>
  76.  
  77. <?php if ($useDefList) : ?>
  78. <dl class="article-info">
  79. <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
  80. <?php endif; ?>
  81. <?php if ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') : ?>
  82. <dd class="parent-category-name">
  83. <?php $title = $this->escape($this->item->parent_title);
  84. $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?>
  85. <?php if ($params->get('link_parent_category') AND $this->item->parent_slug) : ?>
  86. <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
  87. <?php else : ?>
  88. <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
  89. <?php endif; ?>
  90. </dd>
  91. <?php endif; ?>
  92. <?php if ($params->get('show_category')) : ?>
  93. <dd class="category-name">
  94. <?php $title = $this->escape($this->item->category_title);
  95. $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
  96. <?php if ($params->get('link_category') AND $this->item->catslug) : ?>
  97. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
  98. <?php else : ?>
  99. <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
  100. <?php endif; ?>
  101. </dd>
  102. <?php endif; ?>
  103. <?php if ($params->get('show_create_date')) : ?>
  104. <dd class="create">
  105. <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date',$this->item->created, JText::_('DATE_FORMAT_LC2'))); ?>
  106. </dd>
  107. <?php endif; ?>
  108. <?php if ($params->get('show_modify_date')) : ?>
  109. <dd class="modified">
  110. <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date',$this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?>
  111. </dd>
  112. <?php endif; ?>
  113. <?php if ($params->get('show_publish_date')) : ?>
  114. <dd class="published">
  115. <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE', JHtml::_('date',$this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?>
  116. </dd>
  117. <?php endif; ?>
  118. <?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
  119. <dd class="createdby">
  120. <?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
  121. <?php if (!empty($this->item->contactid) && $params->get('link_author') == true): ?>
  122. <?php
  123. $needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
  124. $item = JSite::getMenu()->getItems('link', $needle, true);
  125. $cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
  126. ?>
  127. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
  128. <?php else: ?>
  129. <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
  130. <?php endif; ?>
  131. </dd>
  132. <?php endif; ?>
  133. <?php if ($params->get('show_hits')) : ?>
  134. <dd class="hits">
  135. <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
  136. </dd>
  137. <?php endif; ?>
  138. <?php if ($useDefList) : ?>
  139. </dl>
  140. <?php endif; ?>
  141.  
  142. <?php if (isset ($this->item->toc)) : ?>
  143. <?php echo $this->item->toc; ?>
  144. <?php endif; ?>
  145. <?php if ($params->get('access-view')):?>
  146. <?php echo $this->item->text; ?>
  147.  
  148. <?php //optional teaser intro text for guests ?>
  149. <?php elseif ($params->get('show_noauth') == true AND $user->get('guest') ) : ?>
  150. <?php echo $this->item->introtext; ?>
  151. <?php //Optional link to let them register to see the whole article. ?>
  152. <?php if ($params->get('show_readmore') && $this->item->fulltext != null) :
  153. $link1 = JRoute::_('index.php?option=com_users&view=login');
  154. $link = new JURI($link1);?>
  155. <p class="readmore">
  156. <a href="<?php echo $link; ?>">
  157. <?php $attribs = json_decode($this->item->attribs); ?>
  158. <?php
  159. if ($attribs->alternative_readmore == null) :
  160. echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
  161. elseif ($readmore = $this->item->alternative_readmore) :
  162. echo $readmore;
  163. if ($params->get('show_readmore_title', 0) != 0) :
  164. echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  165. endif;
  166. elseif ($params->get('show_readmore_title', 0) == 0) :
  167. echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
  168. else :
  169. echo JText::_('COM_CONTENT_READ_MORE');
  170. echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
  171. endif; ?></a>
  172. </p>
  173. <?php endif; ?>
  174. <?php endif; ?>
  175. <?php echo $this->item->event->afterDisplayContent; ?>
  176. </div>
Add Comment
Please, Sign In to add comment