You've already forked joomla_test
first commit
This commit is contained in:
1
components/com_content/views/article/index.html
Normal file
1
components/com_content/views/article/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
7
components/com_content/views/article/metadata.xml
Normal file
7
components/com_content/views/article/metadata.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view
|
||||
title="Article">
|
||||
<message><![CDATA[TYPEARTICLAYDESC]]></message>
|
||||
</view>
|
||||
</metadata>
|
294
components/com_content/views/article/tmpl/default.php
Normal file
294
components/com_content/views/article/tmpl/default.php
Normal file
@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
|
||||
|
||||
// Create shortcuts to some parameters.
|
||||
$params = $this->item->params;
|
||||
$images = json_decode($this->item->images);
|
||||
$urls = json_decode($this->item->urls);
|
||||
$canEdit = $params->get('access-edit');
|
||||
$user = JFactory::getUser();
|
||||
$info = $params->get('info_block_position', 0);
|
||||
JHtml::_('behavior.caption');
|
||||
|
||||
?>
|
||||
<div class="item-page<?php echo $this->pageclass_sfx?>">
|
||||
<?php if ($this->params->get('show_page_heading') && $params->get('show_title')) : ?>
|
||||
<div class="page-header">
|
||||
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
|
||||
</div>
|
||||
<?php endif;
|
||||
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
|
||||
{
|
||||
echo $this->item->pagination;
|
||||
}
|
||||
?>
|
||||
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
|
||||
<div class="page-header">
|
||||
<h2>
|
||||
<?php if ($this->item->state == 0) : ?>
|
||||
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_title')) : ?>
|
||||
<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
|
||||
<a href="<?php echo $this->item->readmore_link; ?>"> <?php echo $this->escape($this->item->title); ?></a>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($this->item->title); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (!$this->print) : ?>
|
||||
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span class="icon-cog"></span> <span class="caret"></span> </a>
|
||||
<?php // Note the actions class is deprecated. Use dropdown-menu instead. ?>
|
||||
<ul class="dropdown-menu actions">
|
||||
<?php if ($params->get('show_print_icon')) : ?>
|
||||
<li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?> </li>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_email_icon')) : ?>
|
||||
<li class="email-icon"> <?php echo JHtml::_('icon.email', $this->item, $params); ?> </li>
|
||||
<?php endif; ?>
|
||||
<?php if ($canEdit) : ?>
|
||||
<li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params); ?> </li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<div class="pull-right">
|
||||
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|
||||
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author')); ?>
|
||||
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
|
||||
<div class="article-info muted">
|
||||
<dl class="article-info">
|
||||
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
|
||||
|
||||
<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
|
||||
<dd class="createdby">
|
||||
<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
|
||||
<?php if (!empty($this->item->contactid) && $params->get('link_author') == true) : ?>
|
||||
<?php
|
||||
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
|
||||
$menu = JFactory::getApplication()->getMenu();
|
||||
$item = $menu->getItems('link', $needle, true);
|
||||
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
|
||||
?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
|
||||
<?php else: ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_parent_category') && !empty($this->item->parent_slug)) : ?>
|
||||
<dd class="parent-category-name">
|
||||
<?php $title = $this->escape($this->item->parent_title);
|
||||
$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?>
|
||||
<?php if ($params->get('link_parent_category') && !empty($this->item->parent_slug)) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_category')) : ?>
|
||||
<dd class="category-name">
|
||||
<?php $title = $this->escape($this->item->category_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) . '">' . $title . '</a>';?>
|
||||
<?php if ($params->get('link_category') && $this->item->catslug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_publish_date')) : ?>
|
||||
<dd class="published">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($info == 0) : ?>
|
||||
<?php if ($params->get('show_modify_date')) : ?>
|
||||
<dd class="modified">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_create_date')) : ?>
|
||||
<dd class="create">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_hits')) : ?>
|
||||
<dd class="hits">
|
||||
<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?>
|
||||
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
||||
|
||||
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?>
|
||||
<?php echo $this->item->event->beforeDisplayContent; ?>
|
||||
|
||||
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|
||||
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
|
||||
<?php echo $this->loadTemplate('links'); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('access-view')):?>
|
||||
<?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
|
||||
<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
|
||||
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
|
||||
<?php if ($images->image_fulltext_caption):
|
||||
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_fulltext_caption) . '"';
|
||||
endif; ?>
|
||||
src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>"/> </div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative):
|
||||
echo $this->item->pagination;
|
||||
endif;
|
||||
?>
|
||||
<?php if (isset ($this->item->toc)) :
|
||||
echo $this->item->toc;
|
||||
endif; ?>
|
||||
<?php echo $this->item->text; ?>
|
||||
|
||||
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
|
||||
<div class="article-info muted">
|
||||
<dl class="article-info">
|
||||
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
|
||||
|
||||
<?php if ($info == 1) : ?>
|
||||
<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
|
||||
<dd class="createdby">
|
||||
<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
|
||||
<?php if (!empty($this->item->contactid) && $params->get('link_author') == true) : ?>
|
||||
<?php
|
||||
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
|
||||
$menu = JFactory::getApplication()->getMenu();
|
||||
$item = $menu->getItems('link', $needle, true);
|
||||
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
|
||||
?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
|
||||
<?php else: ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_parent_category') && !empty($this->item->parent_slug)) : ?>
|
||||
<dd class="parent-category-name">
|
||||
<?php $title = $this->escape($this->item->parent_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)) . '">' . $title . '</a>';?>
|
||||
<?php if ($params->get('link_parent_category') && $this->item->parent_slug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_category')) : ?>
|
||||
<dd class="category-name">
|
||||
<?php $title = $this->escape($this->item->category_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) . '">' . $title . '</a>';?>
|
||||
<?php if ($params->get('link_category') && $this->item->catslug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_publish_date')) : ?>
|
||||
<dd class="published">
|
||||
<span class="icon-calendar"></span>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_create_date')) : ?>
|
||||
<dd class="create">
|
||||
<span class="icon-calendar"></span>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_modify_date')) : ?>
|
||||
<dd class="modified">
|
||||
<span class="icon-calendar"></span>
|
||||
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_hits')) : ?>
|
||||
<dd class="hits">
|
||||
<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative):
|
||||
echo $this->item->pagination;
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
|
||||
<?php echo $this->loadTemplate('links'); ?>
|
||||
<?php endif; ?>
|
||||
<?php // Optional teaser intro text for guests ?>
|
||||
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
|
||||
<?php echo $this->item->introtext; ?>
|
||||
<?php //Optional link to let them register to see the whole article. ?>
|
||||
<?php if ($params->get('show_readmore') && $this->item->fulltext != null) :
|
||||
$link1 = JRoute::_('index.php?option=com_users&view=login');
|
||||
$link = new JUri($link1);?>
|
||||
<p class="readmore">
|
||||
<a href="<?php echo $link; ?>">
|
||||
<?php $attribs = json_decode($this->item->attribs); ?>
|
||||
<?php
|
||||
if ($attribs->alternative_readmore == null) :
|
||||
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
|
||||
elseif ($readmore = $this->item->alternative_readmore) :
|
||||
echo $readmore;
|
||||
if ($params->get('show_readmore_title', 0) != 0) :
|
||||
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
|
||||
endif;
|
||||
elseif ($params->get('show_readmore_title', 0) == 0) :
|
||||
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
|
||||
else :
|
||||
echo JText::_('COM_CONTENT_READ_MORE');
|
||||
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
|
||||
endif; ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
|
||||
echo $this->item->pagination;
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->item->event->afterDisplayContent; ?> </div>
|
288
components/com_content/views/article/tmpl/default.xml
Normal file
288
components/com_content/views/article/tmpl/default.xml
Normal file
@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="com_content_article_view_default_title" option="com_content_article_view_default_option">
|
||||
<help
|
||||
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_SINGLE_ARTICLE"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[com_content_article_view_default_desc]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the request variables for the layout. -->
|
||||
<fields name="request">
|
||||
<fieldset name="request"
|
||||
addfieldpath="/administrator/components/com_content/models/fields">
|
||||
|
||||
<field name="id" type="modal_article"
|
||||
label="COM_CONTENT_FIELD_SELECT_ARTICLE_LABEL"
|
||||
required="true"
|
||||
edit="true"
|
||||
clear="false"
|
||||
description="COM_CONTENT_FIELD_SELECT_ARTICLE_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
|
||||
<!-- Basic options. -->
|
||||
<fieldset name="basic"
|
||||
label="COM_CONTENT_ATTRIBS_ARTICLE_SETTINGS_LABEL">
|
||||
|
||||
<field
|
||||
name="show_title"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_TITLE_LABEL"
|
||||
description="JGLOBAL_SHOW_TITLE_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_titles"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_LINKED_TITLES_LABEL"
|
||||
description="JGLOBAL_LINKED_TITLES_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_intro"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
description="JGLOBAL_SHOW_INTRO_DESC"
|
||||
label="JGLOBAL_SHOW_INTRO_LABEL">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="info_block_position"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
|
||||
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
|
||||
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
|
||||
<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
|
||||
</field>
|
||||
|
||||
|
||||
<field
|
||||
name="show_category"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_CATEGORY_LABEL"
|
||||
description="JGLOBAL_SHOW_CATEGORY_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_category"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_LINK_CATEGORY_LABEL"
|
||||
description="JGLOBAL_LINK_CATEGORY_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_parent_category"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
|
||||
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_parent_category"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
|
||||
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_author"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_AUTHOR_LABEL"
|
||||
description="JGLOBAL_SHOW_AUTHOR_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_author"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_LINK_AUTHOR_LABEL"
|
||||
description="JGLOBAL_LINK_AUTHOR_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_create_date"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
|
||||
description="JGLOBAL_SHOW_CREATE_DATE_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_modify_date"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
|
||||
description="JGLOBAL_SHOW_MODIFY_DATE_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_publish_date"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
|
||||
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_item_navigation"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
|
||||
description="JGLOBAL_SHOW_NAVIGATION_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_vote"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_VOTE_LABEL"
|
||||
description="JGLOBAL_SHOW_VOTE_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="show_tags"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL"
|
||||
description="COM_CONTENT_FIELD_SHOW_TAGS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_icons"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_ICONS_LABEL"
|
||||
description="JGLOBAL_SHOW_ICONS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_print_icon"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
|
||||
description="JGLOBAL_SHOW_PRINT_ICON_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_email_icon"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
|
||||
description="JGLOBAL_SHOW_EMAIL_ICON_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_hits"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_HITS_LABEL"
|
||||
description="JGLOBAL_SHOW_HITS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_tags"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_TAGS_LABEL"
|
||||
description="JGLOBAL_SHOW_TAGS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_noauth"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
|
||||
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="urls_position"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
label="COM_CONTENT_FIELD_URLSPOSITION_LABEL"
|
||||
description="COM_CONTENT_FIELD_URLSPOSITION_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
|
||||
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
79
components/com_content/views/article/tmpl/default_links.php
Normal file
79
components/com_content/views/article/tmpl/default_links.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Create shortcut
|
||||
$urls = json_decode($this->item->urls);
|
||||
|
||||
// Create shortcuts to some parameters.
|
||||
$params = $this->item->params;
|
||||
if ($urls && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) :
|
||||
?>
|
||||
<div class="content-links">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
<?php
|
||||
$urlarray = array(
|
||||
array($urls->urla, $urls->urlatext, $urls->targeta, 'a'),
|
||||
array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'),
|
||||
array($urls->urlc, $urls->urlctext, $urls->targetc, 'c')
|
||||
);
|
||||
foreach ($urlarray as $url) :
|
||||
$link = $url[0];
|
||||
$label = $url[1];
|
||||
$target = $url[2];
|
||||
$id = $url[3];
|
||||
|
||||
if ( ! $link) :
|
||||
continue;
|
||||
endif;
|
||||
|
||||
// If no label is present, take the link
|
||||
$label = ($label) ? $label : $link;
|
||||
|
||||
// If no target is present, use the default
|
||||
$target = $target ? $target : $params->get('target'.$id);
|
||||
?>
|
||||
<li class="content-links-<?php echo $id; ?>">
|
||||
<?php
|
||||
// Compute the correct link
|
||||
|
||||
switch ($target)
|
||||
{
|
||||
case 1:
|
||||
// open in a new window
|
||||
echo '<a href="'. htmlspecialchars($link) .'" target="_blank" rel="nofollow">'.
|
||||
htmlspecialchars($label) .'</a>';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// open in a popup window
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
|
||||
echo "<a href=\"" . htmlspecialchars($link) . "\" onclick=\"window.open(this.href, 'targetWindow', '".$attribs."'); return false;\">".
|
||||
htmlspecialchars($label).'</a>';
|
||||
break;
|
||||
case 3:
|
||||
// open in a modal window
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
echo '<a class="modal" href="'.htmlspecialchars($link).'" rel="{handler: \'iframe\', size: {x:600, y:600}}">'.
|
||||
htmlspecialchars($label) . ' </a>';
|
||||
break;
|
||||
|
||||
default:
|
||||
// open in parent window
|
||||
echo '<a href="'. htmlspecialchars($link) . '" rel="nofollow">'.
|
||||
htmlspecialchars($label) . ' </a>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
1
components/com_content/views/article/tmpl/index.html
Normal file
1
components/com_content/views/article/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
301
components/com_content/views/article/view.html.php
Normal file
301
components/com_content/views/article/view.html.php
Normal file
@ -0,0 +1,301 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* HTML Article View class for the Content component
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
* @since 1.5
|
||||
*/
|
||||
class ContentViewArticle extends JViewLegacy
|
||||
{
|
||||
protected $item;
|
||||
|
||||
protected $params;
|
||||
|
||||
protected $print;
|
||||
|
||||
protected $state;
|
||||
|
||||
protected $user;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$dispatcher = JEventDispatcher::getInstance();
|
||||
|
||||
$this->item = $this->get('Item');
|
||||
$this->print = $app->input->getBool('print');
|
||||
$this->state = $this->get('State');
|
||||
$this->user = $user;
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
JError::raiseWarning(500, implode("\n", $errors));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a shortcut for $item.
|
||||
$item = $this->item;
|
||||
$item->tagLayout = new JLayoutFile('joomla.content.tags');
|
||||
|
||||
// Add router helpers.
|
||||
$item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id;
|
||||
$item->catslug = $item->category_alias ? ($item->catid.':'.$item->category_alias) : $item->catid;
|
||||
$item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id;
|
||||
|
||||
// No link for ROOT category
|
||||
if ($item->parent_alias == 'root')
|
||||
{
|
||||
$item->parent_slug = null;
|
||||
}
|
||||
|
||||
// TODO: Change based on shownoauth
|
||||
$item->readmore_link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
|
||||
|
||||
// Merge article params. If this is single-article view, menu params override article params
|
||||
// Otherwise, article params override menu item params
|
||||
$this->params = $this->state->get('params');
|
||||
$active = $app->getMenu()->getActive();
|
||||
$temp = clone ($this->params);
|
||||
|
||||
// Check to see which parameters should take priority
|
||||
if ($active)
|
||||
{
|
||||
$currentLink = $active->link;
|
||||
|
||||
// If the current view is the active item and an article view for this article, then the menu item params take priority
|
||||
if (strpos($currentLink, 'view=article') && (strpos($currentLink, '&id='.(string) $item->id)))
|
||||
{
|
||||
// Load layout from active query (in case it is an alternative menu item)
|
||||
if (isset($active->query['layout']))
|
||||
{
|
||||
$this->setLayout($active->query['layout']);
|
||||
}
|
||||
// Check for alternative layout of article
|
||||
elseif ($layout = $item->params->get('article_layout'))
|
||||
{
|
||||
$this->setLayout($layout);
|
||||
}
|
||||
|
||||
// $item->params are the article params, $temp are the menu item params
|
||||
// Merge so that the menu item params take priority
|
||||
$item->params->merge($temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Current view is not a single article, so the article params take priority here
|
||||
// Merge the menu item params with the article params so that the article params take priority
|
||||
$temp->merge($item->params);
|
||||
$item->params = $temp;
|
||||
|
||||
// Check for alternative layouts (since we are not in a single-article menu item)
|
||||
// Single-article menu item layout takes priority over alt layout for an article
|
||||
if ($layout = $item->params->get('article_layout'))
|
||||
{
|
||||
$this->setLayout($layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Merge so that article params take priority
|
||||
$temp->merge($item->params);
|
||||
$item->params = $temp;
|
||||
|
||||
// Check for alternative layouts (since we are not in a single-article menu item)
|
||||
// Single-article menu item layout takes priority over alt layout for an article
|
||||
if ($layout = $item->params->get('article_layout'))
|
||||
{
|
||||
$this->setLayout($layout);
|
||||
}
|
||||
}
|
||||
|
||||
$offset = $this->state->get('list.offset');
|
||||
|
||||
// Check the view access to the article (the model has already computed the values).
|
||||
if ($item->params->get('access-view') != true && (($item->params->get('show_noauth') != true && $user->get('guest') )))
|
||||
{
|
||||
JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($item->params->get('show_intro', '1') == '1')
|
||||
{
|
||||
$item->text = $item->introtext.' '.$item->fulltext;
|
||||
}
|
||||
elseif ($item->fulltext)
|
||||
{
|
||||
$item->text = $item->fulltext;
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->text = $item->introtext;
|
||||
}
|
||||
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getItemTags('com_content.article', $this->item->id);
|
||||
|
||||
// Process the content plugins.
|
||||
|
||||
JPluginHelper::importPlugin('content');
|
||||
$dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$this->params, $offset));
|
||||
|
||||
$item->event = new stdClass;
|
||||
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content.article', &$item, &$this->params, $offset));
|
||||
$item->event->afterDisplayTitle = trim(implode("\n", $results));
|
||||
|
||||
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$this->params, $offset));
|
||||
$item->event->beforeDisplayContent = trim(implode("\n", $results));
|
||||
|
||||
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_content.article', &$item, &$this->params, $offset));
|
||||
$item->event->afterDisplayContent = trim(implode("\n", $results));
|
||||
|
||||
// Increment the hit counter of the article.
|
||||
if (!$this->params->get('intro_only') && $offset == 0)
|
||||
{
|
||||
$model = $this->getModel();
|
||||
$model->hit();
|
||||
}
|
||||
|
||||
//Escape strings for HTML output
|
||||
$this->pageclass_sfx = htmlspecialchars($this->item->params->get('pageclass_sfx'));
|
||||
|
||||
$this->_prepareDocument();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$menus = $app->getMenu();
|
||||
$pathway = $app->getPathway();
|
||||
$title = null;
|
||||
|
||||
// Because the application sets a default page title,
|
||||
// we need to get it from the menu item itself
|
||||
$menu = $menus->getActive();
|
||||
|
||||
if ($menu)
|
||||
{
|
||||
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES'));
|
||||
}
|
||||
|
||||
$title = $this->params->get('page_title', '');
|
||||
|
||||
$id = (int) @$menu->query['id'];
|
||||
|
||||
// if the menu item does not concern this article
|
||||
if ($menu && ($menu->query['option'] != 'com_content' || $menu->query['view'] != 'article' || $id != $this->item->id))
|
||||
{
|
||||
// If this is not a single article menu item, set the page title to the article title
|
||||
if ($this->item->title)
|
||||
{
|
||||
$title = $this->item->title;
|
||||
}
|
||||
$path = array(array('title' => $this->item->title, 'link' => ''));
|
||||
$category = JCategories::getInstance('Content')->get($this->item->catid);
|
||||
|
||||
while ($category && ($menu->query['option'] != 'com_content' || $menu->query['view'] == 'article' || $id != $category->id) && $category->id > 1)
|
||||
{
|
||||
$path[] = array('title' => $category->title, 'link' => ContentHelperRoute::getCategoryRoute($category->id));
|
||||
$category = $category->getParent();
|
||||
}
|
||||
$path = array_reverse($path);
|
||||
|
||||
foreach ($path as $item)
|
||||
{
|
||||
$pathway->addItem($item['title'], $item['link']);
|
||||
}
|
||||
}
|
||||
|
||||
// Check for empty title and add site name if param is set
|
||||
if (empty($title))
|
||||
{
|
||||
$title = $app->getCfg('sitename');
|
||||
}
|
||||
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
|
||||
}
|
||||
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
|
||||
{
|
||||
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
|
||||
}
|
||||
|
||||
if (empty($title))
|
||||
{
|
||||
$title = $this->item->title;
|
||||
}
|
||||
$this->document->setTitle($title);
|
||||
|
||||
if ($this->item->metadesc)
|
||||
{
|
||||
$this->document->setDescription($this->item->metadesc);
|
||||
}
|
||||
elseif (!$this->item->metadesc && $this->params->get('menu-meta_description'))
|
||||
{
|
||||
$this->document->setDescription($this->params->get('menu-meta_description'));
|
||||
}
|
||||
|
||||
if ($this->item->metakey)
|
||||
{
|
||||
$this->document->setMetadata('keywords', $this->item->metakey);
|
||||
}
|
||||
elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords'))
|
||||
{
|
||||
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($this->params->get('robots'))
|
||||
{
|
||||
$this->document->setMetadata('robots', $this->params->get('robots'));
|
||||
}
|
||||
|
||||
if ($app->getCfg('MetaAuthor') == '1')
|
||||
{
|
||||
$this->document->setMetaData('author', $this->item->author);
|
||||
}
|
||||
|
||||
$mdata = $this->item->metadata->toArray();
|
||||
|
||||
foreach ($mdata as $k => $v)
|
||||
{
|
||||
if ($v)
|
||||
{
|
||||
$this->document->setMetadata($k, $v);
|
||||
}
|
||||
}
|
||||
|
||||
// If there is a pagebreak heading or title, add it to the page title
|
||||
if (!empty($this->item->page_title))
|
||||
{
|
||||
$this->item->title = $this->item->title . ' - ' . $this->item->page_title;
|
||||
$this->document->setTitle($this->item->page_title . ' - ' . JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $this->state->get('list.offset') + 1));
|
||||
}
|
||||
|
||||
if ($this->print)
|
||||
{
|
||||
$this->document->setMetaData('robots', 'noindex, nofollow');
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user