english/components/com_newsfeeds/models/category.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)
	{
		$app	= JFactory::getApplication();
		$params	= JComponentHelper::getParams('com_newsfeeds');
		$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
		$this->setState('list.limit', $limit);
		$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
		$this->setState('list.start', $limitstart);
		$orderCol	= JRequest::getCmd('filter_order', 'ordering');
		if (!in_array($orderCol, $this->filter_fields)) {
			$orderCol = 'ordering';
		}
		$this->setState('list.ordering', $orderCol);
		$listOrder	=  JRequest::getCmd('filter_order_Dir', 'ASC');
		if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) {
			$listOrder = 'ASC';
		}
		$this->setState('list.direction', $listOrder);
		$id = JRequest::getVar('id', 0, '', 'int');
		$this->setState('category.id', $id);
		$user = JFactory::getUser();
		if ((!$user->authorise('core.edit.state', 'com_newsfeeds')) &&  (!$user->authorise('core.edit', 'com_newsfeeds'))){
			$this->setState('filter.published',	1);
			$this->setState('filter.publish_date', true);
		}
		$this->setState('filter.language',$app->getLanguageFilter());
		$this->setState('params', $params);
	}
protected function populateState ( $ ordering = null , $ direction = null ) { $ app = JFactory :: getApplication ( ) ; $ params = JComponentHelper :: getParams ( 'com_newsfeeds' ) ; $ limit = $ app -> getUserStateFromRequest ( 'global.list.limit' , 'limit' , $ app -> getCfg ( 'list_limit' ) ) ; $ this -> setState ( 'list.limit' , $ limit ) ; $ limitstart = JRequest :: getVar ( 'limitstart' , 0 , '' , 'int' ) ; $ this -> setState ( 'list.start' , $ limitstart ) ; $ orderCol = JRequest :: getCmd ( 'filter_order' , 'ordering' ) ; if ( ! in_array ( $ orderCol , $ this -> filter_fields ) ) { $ orderCol = 'ordering' ; } $ this -> setState ( 'list.ordering' , $ orderCol ) ; $ listOrder = JRequest :: getCmd ( 'filter_order_Dir' , 'ASC' ) ; if ( ! in_array ( strtoupper ( $ listOrder ) , array ( 'ASC' , 'DESC' , '' ) ) ) { $ listOrder = 'ASC' ; } $ this -> setState ( 'list.direction' , $ listOrder ) ; $ id = JRequest :: getVar ( 'id' , 0 , '' , 'int' ) ; $ this -> setState ( 'category.id' , $ id ) ; $ user = JFactory :: getUser ( ) ; if ( ( ! $ user -> authorise ( 'core.edit.state' , 'com_newsfeeds' ) ) && ( ! $ user -> authorise ( 'core.edit' , 'com_newsfeeds' ) ) ) { $ this -> setState ( 'filter.published' , 1 ) ; $ this -> setState ( 'filter.publish_date' , true ) ; } $ this -> setState ( 'filter.language' , $ app -> getLanguageFilter ( ) ) ; $ this -> setState ( 'params' , $ params ) ; }
Method to auto-populate the model state.
Method to auto - populate the model state .
// Initialise variables. // List state information // limit to published for people who can't edit or edit.state. // Filter by start and end dates. // Load the parameters.