/** * Method to auto-populate the model state. * * @return void */ protected function _populateState() { parent::_populateState(); $cid = JRequest::getVar('cid', array(0), '', 'array'); $id = JRequest::getVar('id', $cid[0], '', 'int'); $this->setState('id', $id); }
/** * Method to auto-populate the model state. * * @return void */ protected function _populateState() { parent::_populateState(); // Initialize variables. $app = JFactory::getApplication(); $context = $this->_context . '.'; // Load the filter state. $published = $app->getUserStateFromRequest($context . 'filter.published', 'published', '*', 'string'); $this->setState('filter.state', $published == '*' ? null : $published); $this->setState('filter.search', $app->getUserStateFromRequest($context . 'filter.search', 'search', '')); // Load the list state. $this->setState('list.start', $app->getUserStateFromRequest($context . 'list.start', 'limitstart', 0, 'int')); $this->setState('list.limit', $app->getUserStateFromRequest($context . 'list.limit', 'limit', $app->getCfg('list_limit'), 'int')); $this->setState('list.ordering', $app->getUserStateFromRequest($context . 'list.ordering', 'filter_order', 'a.ordering', 'cmd')); $this->setState('list.direction', $app->getUserStateFromRequest($context . 'list.direction', 'filter_order_Dir', 'ASC', 'word')); }