/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering The field to order on. * @param string $direction The direction to order on. * * @return void. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { parent::populateState($ordering, $direction); $input = JFactory::getApplication()->input; $user = JFactory::getUser(); // 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.limit', $limit); $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', 1); } else { $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 auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering The field to order on. * @param string $direction The direction to order on. * * @return void. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { parent::populateState(); $app = JFactory::getApplication(); // Add archive properties $params = $this->state->params; // Filter on archived articles $this->setState('filter.published', 2); // Filter on month, year $this->setState('filter.month', $app->input->getInt('month')); $this->setState('filter.year', $app->input->getInt('year')); // Optional filter text $this->setState('list.filter', $app->input->getString('filter-search')); // Get list limit $itemid = $app->input->get('Itemid', 0, 'int'); $limit = $app->getUserStateFromRequest('com_content.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); $this->setState('list.limit', $limit); // Set the archive ordering $articleOrderby = $params->get('orderby_sec', 'rdate'); $articleOrderDate = $params->get('order_date'); // No category ordering $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); $this->setState('list.ordering', $secondary . ', a.created DESC'); $this->setState('list.direction', ''); }
/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering The field to order on. * @param string $direction The direction to order on. * * @return void. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { parent::populateState($ordering, $direction); $input = JFactory::getApplication()->input; $user = JFactory::getUser(); // 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.limit', $limit); $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', 1); } else { $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); } $articleOrderby = $params->get('orderby_sec', 'rdate'); $articleOrderDate = $params->get('order_date'); $categoryOrderby = $params->def('orderby_pri', ''); $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); $primary = ContentHelperQuery::orderbyPrimary($categoryOrderby); $this->setState('list.ordering', $primary . $secondary . ', a.created DESC'); $this->setState('list.direction', ''); }
/** * Method to auto-populate the model state. * * This method should only be called once per instantiation and is designed * to be called on the first call to the getState() method unless the model * configuration flag to ignore the request is set. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 12.2 */ protected function populateState($ordering = 'ordering', $direction = 'ASC') { parent::populateState($ordering, $direction); $params = JFactory::getApplication()->getParams('com_content'); $this->setState('params', $params); // Process show_noauth parameter $this->setState('filter.access', !$params->get('show_noauth')); }
protected function populateState($ordering = null, $direction = null) { // Adjust the context to support modal layouts. if ($layout = JRequest::getVar('layout')) { $this->context .= '.' . $layout; } $search = $this->getUserStateFromRequest($this->context . '.tag.filter.search', 'tag_filter_search'); $this->setState('tag.filter.search', $search); // List state information. parent::populateState('a.title', 'asc'); }
protected function populateState($ordering = null, $direction = null) { $app = JFactory::getApplication(); $session = JFactory::getSession(); if ($layout = JRequest::getVar('layout')) { $this->context .= '.'.$layout; } //$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $search = JRequest::getVar('filter_search'); $this->setState('filter.search', $search); //$access = $this->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', 0, 'int'); $access = JRequest::getVar('filter_access'); $this->setState('filter.access', $access); //$authorId = $app->getUserStateFromRequest($this->context.'.filter.author_id', 'filter_author_id'); $authorId = JRequest::getVar('filter_author_id'); $this->setState('filter.author_id', $authorId); //$published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', ''); $published = JRequest::getVar('published'); $this->setState('filter.published', $published); //$categoryId = $this->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id'); $categoryId = JRequest::getVar('category_id'); $this->setState('filter.category_id', $categoryId); //$language = $this->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', ''); $language = JRequest::getVar('language'); $this->setState('filter.language', $language); if(JRequest::getVar('order_key')!==0 && JRequest::getVar('order_filter')!==0){ //print_r(JRequest::getVar('order_key'));print_r(JRequest::getVar('order_filter'));die; $orderCol = JRequest::getVar('order_key'); $orderDirn = JRequest::getVar('order_filter'); } //print_r($orderCol);print_r($orderDirn);die; parent::populateState('a.'.$orderCol, $orderDirn); }
/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering The field to order on. * @param string $direction The direction to order on. * * @return void. * * @since 1.6 */ protected function populateState($ordering = null, $direction = null) { parent::populateState(); $app = JFactory::getApplication(); // Add archive properties $params = $this->state->params; // Filter on archived articles $this->setState('filter.published', 2); // Filter on month, year $this->setState('filter.month', $app->input->getInt('month')); $this->setState('filter.year', $app->input->getInt('year')); // Optional filter text $this->setState('list.filter', $app->input->getString('filter-search')); // Get list limit $itemid = $app->input->get('Itemid', 0, 'int'); $limit = $app->getUserStateFromRequest('com_content.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); $this->setState('list.limit', $limit); }
/** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 3.5 */ protected function populateState($ordering = 'a.title', $direction = 'asc') { parent::populateState($ordering, $direction); }