You've already forked joomla_test
first commit
This commit is contained in:
1
components/com_content/views/archive/index.html
Normal file
1
components/com_content/views/archive/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
6
components/com_content/views/archive/metadata.xml
Normal file
6
components/com_content/views/archive/metadata.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<view title="Archive">
|
||||
<message><![CDATA[TYPEARCHLAYDESC]]></message>
|
||||
</view>
|
||||
</metadata>
|
45
components/com_content/views/archive/tmpl/default.php
Normal file
45
components/com_content/views/archive/tmpl/default.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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');
|
||||
|
||||
JHtml::_('behavior.caption');
|
||||
?>
|
||||
<div class="archive<?php echo $this->pageclass_sfx;?>">
|
||||
<?php if ($this->params->get('show_page_heading', 1)) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form id="adminForm" action="<?php echo JRoute::_('index.php')?>" method="post" class="form-inline">
|
||||
<fieldset class="filters">
|
||||
<div class="filter-search alert alert-info">
|
||||
<?php if ($this->params->get('filter_field') != 'hide') : ?>
|
||||
<label class="filter-search-lbl" for="filter-search"><?php echo JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' '; ?></label>
|
||||
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->filter); ?>" class="inputbox span2" onchange="document.getElementById('adminForm').submit();" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $this->form->monthField; ?>
|
||||
<?php echo $this->form->yearField; ?>
|
||||
<?php echo $this->form->limitField; ?>
|
||||
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><?php echo JText::_('JGLOBAL_FILTER_BUTTON'); ?></button>
|
||||
<input type="hidden" name="view" value="archive" />
|
||||
<input type="hidden" name="option" value="com_content" />
|
||||
<input type="hidden" name="limitstart" value="0" />
|
||||
</fieldset>
|
||||
|
||||
<?php echo $this->loadTemplate('items'); ?>
|
||||
</form>
|
||||
</div>
|
221
components/com_content/views/archive/tmpl/default.xml
Normal file
221
components/com_content/views/archive/tmpl/default.xml
Normal file
@ -0,0 +1,221 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="com_content_archive_view_default_title" option="com_content_archive_view_default_option">
|
||||
<help
|
||||
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[com_content_archive_view_default_desc]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
|
||||
<!-- Basic options. -->
|
||||
<fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS"
|
||||
>
|
||||
|
||||
<field name="orderby_sec" type="list"
|
||||
default="alpha"
|
||||
description="JGLOBAL_ARTICLE_ORDER_DESC"
|
||||
label="JGLOBAL_ARTICLE_ORDER_LABEL"
|
||||
>
|
||||
<option value="date">JGLOBAL_OLDEST_FIRST</option>
|
||||
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
|
||||
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
|
||||
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
|
||||
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
|
||||
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
|
||||
<option value="hits">JGLOBAL_MOST_HITS</option>
|
||||
<option value="rhits">JGLOBAL_LEAST_HITS</option>
|
||||
<option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option>
|
||||
</field>
|
||||
|
||||
<field name="order_date" type="list"
|
||||
default="created"
|
||||
description="JGLOBAL_ORDERING_DATE_DESC"
|
||||
label="JGLOBAL_ORDERING_DATE_LABEL"
|
||||
>
|
||||
<option value="created">JGLOBAL_Created</option>
|
||||
<option value="modified">JGLOBAL_Modified</option>
|
||||
<option value="published">JPUBLISHED</option>
|
||||
</field>
|
||||
|
||||
<field name="display_num" type="list"
|
||||
default="5"
|
||||
description="JGLOBAL_NUMBER_ITEMS_LIST_DESC"
|
||||
label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL"
|
||||
>
|
||||
<option value="5">J5</option>
|
||||
<option value="10">J10</option>
|
||||
<option value="15">J15</option>
|
||||
<option value="20">J20</option>
|
||||
<option value="25">J25</option>
|
||||
<option value="30">J30</option>
|
||||
<option value="50">J50</option>
|
||||
<option value="100">J100</option>
|
||||
<option value="0">JALL</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="filter_field"
|
||||
type="list"
|
||||
default=""
|
||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="hide">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="introtext_limit" type="text" default="100"
|
||||
label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL"
|
||||
description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC" />
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!-- Articles options. -->
|
||||
<fieldset name="articles"
|
||||
label="COM_CONTENT_ATTRIBS_ARTICLE_SETTINGS_LABEL"
|
||||
>
|
||||
|
||||
<field name="show_intro" type="list"
|
||||
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="list"
|
||||
default=""
|
||||
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
|
||||
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</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="list"
|
||||
description="JGLOBAL_SHOW_CATEGORY_DESC"
|
||||
label="JGLOBAL_SHOW_CATEGORY_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="link_category" type="list"
|
||||
description="JGLOBAL_LINK_CATEGORY_DESC"
|
||||
label="JGLOBAL_LINK_CATEGORY_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNo</option>
|
||||
<option value="1">JYes</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_parent_category"
|
||||
type="list"
|
||||
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="list"
|
||||
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="link_titles" type="list"
|
||||
description="JGLOBAL_LINKED_TITLES_DESC"
|
||||
label="JGLOBAL_LINKED_TITLES_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="show_author" type="list"
|
||||
description="JGLOBAL_SHOW_AUTHOR_DESC"
|
||||
label="JGLOBAL_SHOW_AUTHOR_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="link_author"
|
||||
type="list"
|
||||
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="list"
|
||||
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
|
||||
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="show_modify_date" type="list"
|
||||
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
|
||||
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="show_publish_date" type="list"
|
||||
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
|
||||
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
|
||||
<field name="show_item_navigation" type="list"
|
||||
description="JGLOBAL_SHOW_NAVIGATION_DESC"
|
||||
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field name="show_hits" type="list"
|
||||
description="JGLOBAL_SHOW_HITS_DESC"
|
||||
label="JGLOBAL_SHOW_HITS_LABEL"
|
||||
>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
</fields>
|
||||
</metadata>
|
190
components/com_content/views/archive/tmpl/default_items.php
Normal file
190
components/com_content/views/archive/tmpl/default_items.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?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');
|
||||
$params = $this->params;
|
||||
?>
|
||||
|
||||
<div id="archive-items">
|
||||
<?php foreach ($this->items as $i => $item) : ?>
|
||||
<?php $info = $item->params->get('info_block_position', 0); ?>
|
||||
<div class="row<?php echo $i % 2; ?>">
|
||||
<div class="page-header">
|
||||
<h2>
|
||||
<?php if ($params->get('link_titles')) : ?>
|
||||
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug)); ?>"> <?php echo $this->escape($item->title); ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $this->escape($item->title); ?>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
<?php if ($params->get('show_author') && !empty($item->author )) : ?>
|
||||
<div class="createdby">
|
||||
<?php $author = $item->author; ?>
|
||||
<?php $author = ($item->created_by_alias ? $item->created_by_alias : $author); ?>
|
||||
<?php if (!empty($item->contactid ) && $params->get('link_author') == true) : ?>
|
||||
<?php echo JText::sprintf(
|
||||
'COM_CONTENT_WRITTEN_BY',
|
||||
JHtml::_('link', JRoute::_('index.php?option=com_contact&view=contact&id='.$item->contactid), $author)
|
||||
); ?>
|
||||
<?php else :?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?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')); ?>
|
||||
<?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_parent_category') && !empty($item->parent_slug)) : ?>
|
||||
<dd>
|
||||
<div class="parent-category-name">
|
||||
<?php $title = $this->escape($item->parent_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)).'">' . $title . '</a>'; ?>
|
||||
<?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_category')) : ?>
|
||||
<dd>
|
||||
<div class="category-name">
|
||||
<?php $title = $this->escape($item->category_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)).'">' . $title . '</a>'; ?>
|
||||
<?php if ($params->get('link_category') && $item->catslug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_publish_date')) : ?>
|
||||
<dd>
|
||||
<div class="published">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($info == 0) : ?>
|
||||
<?php if ($params->get('show_modify_date')) : ?>
|
||||
<dd>
|
||||
<div class="modified">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_create_date')) : ?>
|
||||
<dd>
|
||||
<div class="create">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_hits')) : ?>
|
||||
<dd>
|
||||
<div class="hits">
|
||||
<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_intro')) :?>
|
||||
<div class="intro"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?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_parent_category') && !empty($item->parent_slug)) : ?>
|
||||
<dd>
|
||||
<div class="parent-category-name">
|
||||
<?php $title = $this->escape($item->parent_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)) . '">' . $title . '</a>';?>
|
||||
<?php if ($params->get('link_parent_category') && $item->parent_slug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_category')) : ?>
|
||||
<dd>
|
||||
<div class="category-name">
|
||||
<?php $title = $this->escape($item->category_title);
|
||||
$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) . '">' . $title . '</a>'; ?>
|
||||
<?php if ($params->get('link_category') && $item->catslug) : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
|
||||
<?php else : ?>
|
||||
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_publish_date')) : ?>
|
||||
<dd>
|
||||
<div class="published">
|
||||
<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($params->get('show_create_date')) : ?>
|
||||
<dd>
|
||||
<div class="create"><span class="icon-calendar">
|
||||
</span> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_modify_date')) : ?>
|
||||
<dd>
|
||||
<div class="modified"><span class="icon-calendar">
|
||||
</span> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php if ($params->get('show_hits')) : ?>
|
||||
<dd>
|
||||
<div class="hits">
|
||||
<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
|
||||
<?php echo $this->pagination->getPagesLinks(); ?>
|
||||
</div>
|
1
components/com_content/views/archive/tmpl/index.html
Normal file
1
components/com_content/views/archive/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
160
components/com_content/views/archive/view.html.php
Normal file
160
components/com_content/views/archive/view.html.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?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 View class for the Content component
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_content
|
||||
* @since 1.5
|
||||
*/
|
||||
class ContentViewArchive extends JViewLegacy
|
||||
{
|
||||
protected $state = null;
|
||||
|
||||
protected $item = null;
|
||||
|
||||
protected $items = null;
|
||||
|
||||
protected $pagination = null;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
|
||||
$state = $this->get('State');
|
||||
$items = $this->get('Items');
|
||||
$pagination = $this->get('Pagination');
|
||||
|
||||
// Get the page/component configuration
|
||||
$params = &$state->params;
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
$form = new stdClass;
|
||||
// Month Field
|
||||
$months = array(
|
||||
'' => JText::_('COM_CONTENT_MONTH'),
|
||||
'01' => JText::_('JANUARY_SHORT'),
|
||||
'02' => JText::_('FEBRUARY_SHORT'),
|
||||
'03' => JText::_('MARCH_SHORT'),
|
||||
'04' => JText::_('APRIL_SHORT'),
|
||||
'05' => JText::_('MAY_SHORT'),
|
||||
'06' => JText::_('JUNE_SHORT'),
|
||||
'07' => JText::_('JULY_SHORT'),
|
||||
'08' => JText::_('AUGUST_SHORT'),
|
||||
'09' => JText::_('SEPTEMBER_SHORT'),
|
||||
'10' => JText::_('OCTOBER_SHORT'),
|
||||
'11' => JText::_('NOVEMBER_SHORT'),
|
||||
'12' => JText::_('DECEMBER_SHORT')
|
||||
);
|
||||
$form->monthField = JHtml::_(
|
||||
'select.genericlist',
|
||||
$months,
|
||||
'month',
|
||||
array(
|
||||
'list.attr' => 'size="1" class="inputbox"',
|
||||
'list.select' => $state->get('filter.month'),
|
||||
'option.key' => null
|
||||
)
|
||||
);
|
||||
// Year Field
|
||||
$years = array();
|
||||
$years[] = JHtml::_('select.option', null, JText::_('JYEAR'));
|
||||
for ($i = 2000; $i <= 2020; $i++)
|
||||
{
|
||||
$years[] = JHtml::_('select.option', $i, $i);
|
||||
}
|
||||
$form->yearField = JHtml::_(
|
||||
'select.genericlist',
|
||||
$years,
|
||||
'year',
|
||||
array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.year'))
|
||||
);
|
||||
$form->limitField = $pagination->getLimitBox();
|
||||
|
||||
//Escape strings for HTML output
|
||||
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
|
||||
|
||||
$this->filter = $state->get('list.filter');
|
||||
$this->form = &$form;
|
||||
$this->items = &$items;
|
||||
$this->params = &$params;
|
||||
$this->user = &$user;
|
||||
$this->pagination = &$pagination;
|
||||
|
||||
$this->_prepareDocument();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$menus = $app->getMenu();
|
||||
$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', '');
|
||||
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'));
|
||||
}
|
||||
$this->document->setTitle($title);
|
||||
|
||||
if ($this->params->get('menu-meta_description'))
|
||||
{
|
||||
$this->document->setDescription($this->params->get('menu-meta_description'));
|
||||
}
|
||||
|
||||
if ($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'));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user