Source for file view.html.php
Documentation is available at view.html.php
* @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
* HTML View class for the Content component
* @subpackage com_content
* @var array Array of leading items for blog display
* @var array Array of intro (multicolumn display) items for blog display
* @var array Array of links in blog display
* @var integer Number of columns in a multi column display
* @var string The name of the extension for the category
* @var string Default title to use for page title
* @var string The name of the view to link individual items to
* Execute and display a template script.
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
* @return mixed A string if successful, otherwise a Error object.
public function display($tpl =
null)
parent::commonCategoryDisplay();
// Get the metrics for the structural page layout.
$numLeading =
$params->def('num_leading_articles', 1);
$numIntro =
$params->def('num_intro_articles', 4);
$numLinks =
$params->def('num_links', 4);
// Compute the article slugs and prepare introtext (runs content plugins).
foreach ($this->items as $item)
$item->slug =
$item->alias ?
($item->id .
':' .
$item->alias) :
$item->id;
$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;
$item->catslug =
$item->category_alias ?
($item->catid.
':'.
$item->category_alias) :
$item->catid;
$item->event =
new stdClass;
// Old plugins: Ensure that text property is available
$item->text =
$item->introtext;
$dispatcher->trigger('onContentPrepare', array ('com_content.category', &$item, &$this->params, 0));
// Old plugins: Use processed text as introtext
$item->introtext =
$item->text;
$results =
$dispatcher->trigger('onContentAfterTitle', array('com_content.category', &$item, &$item->params, 0));
$item->event->afterDisplayTitle =
trim(implode("\n", $results));
$results =
$dispatcher->trigger('onContentBeforeDisplay', array('com_content.category', &$item, &$item->params, 0));
$item->event->beforeDisplayContent =
trim(implode("\n", $results));
$results =
$dispatcher->trigger('onContentAfterDisplay', array('com_content.category', &$item, &$item->params, 0));
$item->event->afterDisplayContent =
trim(implode("\n", $results));
// Check for layout override only if this is not the active menu item
// If it is the active menu item, then the view and category id will match
$active =
$app->getMenu()->getActive();
if ((!$active) ||
((strpos($active->link, 'view=category') ===
false) ||
(strpos($active->link, '&id=' . (string)
$this->category->id) ===
false)))
// Get the layout from the merged category params
if ($layout =
$this->category->params->get('category_layout'))
// At this point, we are in a menu item, so we don't override the layout
elseif (isset
($active->query['layout']))
// We need to set the layout from the query in case this is an alternative menu item (with an alternative layout)
// For blog layouts, preprocess the breakdown of leading, intro and linked articles.
// This makes it much easier for the designer to just interrogate the arrays.
if (($params->get('layout_type') ==
'blog') ||
($this->getLayout() ==
'blog'))
//$max = count($this->items);
foreach ($this->items as $i =>
$item)
elseif ($i >=
$numLeading &&
$i <
$numLeading +
$numIntro)
elseif ($i <
$numLeading +
$numIntro +
$numLinks)
$this->columns =
max(1, $params->def('num_columns', 1));
$params->def('multi_column_order', 1);
parent::prepareDocument();
$id = (int)
@$menu->query['id'];
if ($menu &&
($menu->query['option'] !=
'com_content' ||
$menu->query['view'] ==
'article' ||
$id !=
$this->category->id))
$path =
array(array('title' =>
$this->category->title, 'link' =>
''));
$category =
$this->category->getParent();
while (($menu->query['option'] !=
'com_content' ||
$menu->query['view'] ==
'article' ||
$id !=
$category->id) &&
$category->id >
1)
$category =
$category->getParent();
$this->pathway->addItem($item['title'], $item['link']);
Documentation generated on Tue, 19 Nov 2013 15:17:04 +0100 by phpDocumentor 1.4.3