english/components/com_content/models/featured.php
/**
	 * Method to auto-populate the model state.
	 *
	 * Note. Calling getState in this method will result in recursion.
	 *
	 * @since	1.6
	 */
Method to auto-populate the model state.
Note. Calling getState in this method will result in recursion.


Method to auto - populate the model state . Note . Calling getState in this method will result in recursion .
protected function populateState($ordering = null, $direction = null)
	{
		parent::populateState($ordering, $direction);
		$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
		$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.limit', $limit);
		$this->setState('list.links', $params->get('num_links'));
		$this->setState('filter.frontpage', true);
		$user		= JFactory::getUser();
		if ((!$user->authorise('core.edit.state', 'com_content')) &&  (!$user->authorise('core.edit', 'com_content'))){
			$this->setState('filter.published', 1);
		}
		else {
			$this->setState('filter.published', array(0, 1, 2));
		}
		if ($params->get('featured_categories') && implode(',', $params->get('featured_categories'))  == true) {
			$featuredCategories = $params->get('featured_categories');
 			$this->setState('filter.frontpage.categories', $featuredCategories);
 		}
	}
protected function populateState ( $ ordering = null , $ direction = null ) { parent :: populateState ( $ ordering , $ direction ) ; $ limitstart = JRequest :: getVar ( 'limitstart' , 0 , '' , 'int' ) ; $ 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.limit' , $ limit ) ; $ this -> setState ( 'list.links' , $ params -> get ( 'num_links' ) ) ; $ this -> setState ( 'filter.frontpage' , true ) ; $ user = JFactory :: getUser ( ) ; if ( ( ! $ user -> authorise ( 'core.edit.state' , 'com_content' ) ) && ( ! $ user -> authorise ( 'core.edit' , 'com_content' ) ) ) { $ this -> setState ( 'filter.published' , 1 ) ; } else { $ this -> setState ( 'filter.published' , array ( 0 , 1 , 2 ) ) ; } if ( $ params -> get ( 'featured_categories' ) && implode ( ',' , $ params -> get ( 'featured_categories' ) ) == true ) { $ featuredCategories = $ params -> get ( 'featured_categories' ) ; $ this -> setState ( 'filter.frontpage.categories' , $ featuredCategories ) ; } }
Method to auto-populate the model state.
Method to auto - populate the model state .
// List state information // filter on published for those who do not have edit or edit.state rights. // check for category selection