Source for file featured.php
Documentation is available at featured.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
require_once __DIR__ .
'/articles.php';
* Frontpage Component Model
* @subpackage com_content
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
protected function populateState($ordering =
null, $direction =
null)
// List state information
$limitstart =
$input->getUInt('limitstart', 0);
$this->setState('list.start', $limitstart);
$params =
$this->state->params;
$limit =
$params->get('num_leading_articles') +
$params->get('num_intro_articles') +
$params->get('num_links');
$this->setState('list.links', $params->get('num_links'));
$this->setState('filter.frontpage', true);
if ((!$user->authorise('core.edit.state', 'com_content')) &&
(!$user->authorise('core.edit', 'com_content'))){
// filter on published for those who do not have edit or edit.state rights.
$this->setState('filter.published', array(0, 1, 2));
// check for category selection
if ($params->get('featured_categories') &&
implode(',', $params->get('featured_categories')) ==
true)
$featuredCategories =
$params->get('featured_categories');
$this->setState('filter.frontpage.categories', $featuredCategories);
* Method to get a list of articles.
* @return mixed An array of objects on success, false on failure.
$params =
clone $this->getState('params');
$limit =
$params->get('num_leading_articles') +
$params->get('num_intro_articles') +
$params->get('num_links');
* Method to get a store id based on model configuration state.
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* @param string $id A prefix for the store id.
* @return string A store id.
$id .=
$this->getState('filter.frontpage');
$params =
$this->state->params;
$articleOrderby =
$params->get('orderby_sec', 'rdate');
$articleOrderDate =
$params->get('order_date');
$categoryOrderby =
$params->def('orderby_pri', '');
$orderby =
$primary .
' ' .
$secondary .
' a.created DESC ';
$this->setState('list.ordering', $orderby);
// Create a new query object.
if ($this->getState('filter.frontpage'))
$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
$featuredCategories =
$this->getState('filter.frontpage.categories');
$query->where('a.catid IN (' .
implode(',', $featuredCategories) .
')');
Documentation generated on Tue, 19 Nov 2013 15:02:51 +0100 by phpDocumentor 1.4.3