本文整理汇总了PHP中JModelList::populateState方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelList::populateState方法的具体用法?PHP JModelList::populateState怎么用?PHP JModelList::populateState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelList
的用法示例。
在下文中一共展示了JModelList::populateState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateState
protected function populateState($ordering = null, $direction = null)
{
// Load the component parameters.
$params = JComponentHelper::getParams($this->option);
$this->setState('params', $params);
// Load filter search.
$value = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $value);
// Load filter state.
$value = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $value);
// Load filter approved state.
$value = $this->getUserStateFromRequest($this->context . '.filter.approved', 'filter_approved', '', 'string');
$this->setState('filter.approved', $value);
// Load filter featured state.
$value = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', '', 'string');
$this->setState('filter.featured', $value);
// Load filter category.
$value = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', 0, 'int');
$this->setState('filter.category_id', $value);
// Load filter type.
$value = $this->getUserStateFromRequest($this->context . '.filter.type_id', 'filter_type_id', 0, 'int');
$this->setState('filter.type_id', $value);
// List state information.
parent::populateState('a.created', 'asc');
}
示例2: populateState
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$session = JFactory::getSession();
$jinput = new Jinput();
// Adjust the context to support modal layouts.
if ($layout = $jinput->get('layout')) {
$this->context .= '.' . $layout;
}
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$trigger = $this->getUserStateFromRequest($this->context . '.filter.trigger', 'filter_trigger');
$this->setState('filter.trigger', $trigger);
$socialtype = $this->getUserStateFromRequest($this->context . '.filter.socialtype', 'filter_socialtype');
$this->setState('filter.socialtype', $socialtype);
$socialpost = $this->getUserStateFromRequest($this->context . '.filter.socialpost', 'filter_socialpost');
$this->setState('filter.socialpost', $socialpost);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
// List state information.
parent::populateState('m.id', 'asc');
}
示例3: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout', 'default', 'cmd')) {
$this->context .= '.' . $layout;
}
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$active = $this->getUserStateFromRequest($this->context . '.filter.active', 'filter_active');
$this->setState('filter.active', $active);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state');
$this->setState('filter.state', $state);
$groupId = $this->getUserStateFromRequest($this->context . '.filter.group', 'filter_group_id', null, 'int');
$this->setState('filter.group_id', $groupId);
$range = $this->getUserStateFromRequest($this->context . '.filter.range', 'filter_range');
$this->setState('filter.range', $range);
$groups = json_decode(base64_decode($app->input->get('groups', '', 'BASE64')));
if (isset($groups)) {
JArrayHelper::toInteger($groups);
}
$this->setState('filter.groups', $groups);
$excluded = json_decode(base64_decode($app->input->get('excluded', '', 'BASE64')));
if (isset($excluded)) {
JArrayHelper::toInteger($excluded);
}
$this->setState('filter.excluded', $excluded);
// Load the parameters.
$params = JComponentHelper::getParams('com_users');
$this->setState('params', $params);
// List state information.
parent::populateState('a.name', 'asc');
}
示例4: populateState
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$session = JFactory::getSession();
// Adjust the context to support modal layouts.
if ($layout = JRequest::getVar('layout')) {
$this->context .= '.' . $layout;
}
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$artist = $app->getUserStateFromRequest($this->context . '.filter.artist', 'filter_artist');
$this->setState('filter.artist', $artist);
$album = $app->getUserStateFromRequest($this->context . '.filter.album', 'filter_album', '');
$this->setState('filter.album', $album);
$categoryId = $app->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);
$userId = $app->getUserStateFromRequest($this->context . '.filter.user_id', 'filter_user_id');
$this->setState('filter.user_id', $userId);
$year = $app->getUserStateFromRequest($this->context . '.filter.year', 'filter_year', '');
$this->setState('filter.year', $year);
// Load the parameters.
$params = $app->getParams();
$this->setState('params', $params);
// process show_noauth parameter
if (!$params->get('show_noauth', 1)) {
$this->setState('filter.access', true);
} else {
$this->setState('filter.access', false);
}
// List state information.
parent::populateState('a.title', 'asc');
}
示例5: populateState
/**
* 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 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string');
$this->setState('filter.published', $state);
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', null);
$this->setState('filter.category_id', $categoryId);
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
// Force a language
$forcedLanguage = $app->input->get('forcedLanguage');
if (!empty($forcedLanguage)) {
$this->setState('filter.language', $forcedLanguage);
$this->setState('filter.forcedLanguage', $forcedLanguage);
}
$tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '');
$this->setState('filter.tag', $tag);
// Load the parameters.
$params = JComponentHelper::getParams('com_newsfeeds');
$this->setState('params', $params);
// List state information.
parent::populateState('a.name', 'asc');
}
示例6: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $app->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string');
$this->setState('filter.state', $published);
//Filtering catid
$this->setState('filter.catid', $app->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid', '', 'string'));
//Filtering access
$this->setState('filter.access', $app->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'string'));
//Filtering language
//Language filters for all languages is a * make it empty
if (JFactory::getApplication()->input->getVar('filter_language') == '*') {
JFactory::getApplication()->input->set('filter_language', '');
}
$this->setState('filter.language', $app->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
// Load the parameters.
$params = JComponentHelper::getParams('com_db8download');
$this->setState('params', $params);
// List state information.
parent::populateState('a.name', 'asc');
}
示例7: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string An optional ordering field.
* @param string An optional direction (asc|desc).
*
* @return void
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$context = $this->context;
$extension = $app->getUserStateFromRequest('com_categories.categories.filter.extension', 'extension', 'com_content', 'cmd');
$this->setState('filter.extension', $extension);
$parts = explode('.', $extension);
// extract the component name
$this->setState('filter.component', $parts[0]);
// extract the optional section name
$this->setState('filter.section', count($parts) > 1 ? $parts[1] : null);
$search = $this->getUserStateFromRequest($context . '.search', 'filter_search');
$this->setState('filter.search', $search);
$level = $this->getUserStateFromRequest($context . '.filter.level', 'filter_level', 0, 'int');
$this->setState('filter.level', $level);
$access = $this->getUserStateFromRequest($context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$published = $this->getUserStateFromRequest($context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$language = $this->getUserStateFromRequest($context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
// List state information.
parent::populateState('a.lft', 'asc');
}
示例8: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
$this->setState('filter.access', $accessId);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $state);
$position = $this->getUserStateFromRequest($this->context . '.filter.position', 'filter_position', '', 'string');
$this->setState('filter.position', $position);
$module = $this->getUserStateFromRequest($this->context . '.filter.module', 'filter_module', '', 'string');
$this->setState('filter.module', $module);
$clientId = $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', 0, 'int', false);
$previousId = $app->getUserState($this->context . '.filter.client_id_previous', null);
if ($previousId != $clientId || $previousId === null) {
$this->getUserStateFromRequest($this->context . '.filter.client_id_previous', 'filter_client_id_previous', 0, 'int', true);
$app->setUserState($this->context . '.filter.client_id_previous', $clientId);
}
$this->setState('filter.client_id', $clientId);
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
// Load the parameters.
$params = JComponentHelper::getParams('com_modules');
$this->setState('params', $params);
// List state information.
parent::populateState('position', 'asc');
}
示例9: populateState
protected function populateState($ordering = null, $direction = null)
{
parent::populateState();
$app = JFactory::getApplication();
$id = JRequest::getVar('id', 0, '', 'int');
$this->setState('airports.id', $id);
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_search');
$this->setState('filter.state', $state);
$level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', 0, 'int');
$this->setState('filter.level', $level);
$country_id = $this->getUserStateFromRequest($this->context . '.filter.country_id', 'filter_country_id', 0, 'int');
$this->setState('filter.country_id', $country_id);
$app = JFactory::getApplication();
$value = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
$limit = $value;
$this->setState('list.limit', $limit);
$value = $app->getUserStateFromRequest($this->context . '.limitstart', 'limitstart', 0);
$limitstart = $limit != 0 ? floor($value / $limit) * $limit : 0;
$this->setState('list.start', $limitstart);
$value = $app->getUserStateFromRequest($this->context . '.ordercol', 'filter_order', $ordering);
$this->setState('list.ordering', $value);
$value = $app->getUserStateFromRequest($this->context . '.orderdirn', 'filter_order_Dir', $direction);
$this->setState('list.direction', $value);
parent::populateState('a.lft', 'asc');
}
示例10: populateState
/**
* 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 1.6
*/
protected function populateState($ordering = 'a.position', $direction = 'asc')
{
$app = JFactory::getApplication();
$layout = $app->input->get('layout', '', 'cmd');
// Adjust the context to support modal layouts.
if ($layout) {
$this->context .= '.' . $layout;
}
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.position', $this->getUserStateFromRequest($this->context . '.filter.position', 'filter_position', '', 'string'));
$this->setState('filter.module', $this->getUserStateFromRequest($this->context . '.filter.module', 'filter_module', '', 'string'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
// If in modal layout on the frontend, state and language are always forced.
if ($app->isSite() && $layout === 'modal') {
$this->setState('filter.language', 'current');
$this->setState('filter.state', 1);
} else {
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'));
}
// Special case for the client id.
if ($app->isSite() || $layout === 'modal') {
$this->setState('client_id', 0);
} else {
$clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int');
$clientId = !in_array($clientId, array(0, 1)) ? 0 : $clientId;
$this->setState('client_id', $clientId);
}
// Load the parameters.
$params = JComponentHelper::getParams('com_modules');
$this->setState('params', $params);
// List state information.
parent::populateState($ordering, $direction);
}
示例11: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Adjust the context to support modal layouts.
if ($layout = JRequest::getVar('layout', 'default')) {
$this->context .= '.' . $layout;
}
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '');
if ($state == '') {
// XXX Check for sites with lots of users: this may hang this page until timeout if we show all users
// XXX so we use a safe filter instead
$total_moodle = JoomdleHelperContent::getMoodleUsersNumber($search);
$db = $this->getDbo();
if ($search != '') {
$searchEscaped = $db->Quote('%' . $db->escape($search, true) . '%', false);
} else {
$searchEscaped = "";
}
$total_joomla = JoomdleHelperContent::getJoomlaUsersNumber($searchEscaped);
$max_users = 1000;
if ($total_joomla > $max_users || $total_moodle > $max_users) {
$state = 'joomla';
}
}
$this->setState('filter.state', $state);
// Load the parameters.
$params = JComponentHelper::getParams('com_joomdle');
$this->setState('params', $params);
// List state information.
parent::populateState('name', 'asc');
}
示例12: populateState
/**
* 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 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
// List state information.
parent::populateState('table', 'asc');
}
示例13: populateState
/**
* 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 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Set ordering.
$orderCol = $app->getUserStateFromRequest($this->context . '.filter_order', 'filter_order');
if (!in_array($orderCol, $this->filter_fields)) {
$orderCol = 'a.id';
}
$this->setState('list.ordering', $orderCol);
// Set ordering direction.
$listOrder = $app->getUserStateFromRequest($this->context . 'filter_order_Dir', 'filter_order_Dir');
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', ''))) {
$listOrder = 'ASC';
}
// Load the filter state.
$published = $app->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string');
$this->setState('filter.published', $published);
// Load the filter search
$search = $app->getUserStateFromRequest($this->context . 'filter.search', 'filter_search');
$this->setState('filter.search', $search);
// Load the parameters.
$params = JComponentHelper::getParams('com_quick2cart');
$this->setState('params', $params);
// List state information.
parent::populateState('a.id', 'asc');
}
示例14: populateState
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
$filterSearch = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '');
$this->setState('filter.search', $filterSearch);
parent::populateState('name', 'asc');
}
示例15: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $app->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string');
$this->setState('filter.state', $published);
//Filtering alerting
$this->setState('filter.alerting', $app->getUserStateFromRequest($this->context . '.filter.alerting', 'filter_alerting', '', 'string'));
//Filtering tickerkat
$this->setState('filter.tickerkat', $app->getUserStateFromRequest($this->context . '.filter.tickerkat', 'filter_tickerkat', '', 'string'));
//Filtering data1
$this->setState('filter.data1', $app->getUserStateFromRequest($this->context . '.filter.data1', 'filter_data1', '', 'string'));
//Filtering date1
$this->setState('filter.date1.from', $app->getUserStateFromRequest($this->context . '.filter.date1.from', 'filter_from_date1', '', 'string'));
$this->setState('filter.date1.to', $app->getUserStateFromRequest($this->context . '.filter.date1.to', 'filter_to_date1', '', 'string'));
//Filtering auswahl_orga
$this->setState('filter.auswahl_orga', $app->getUserStateFromRequest($this->context . '.filter.auswahl_orga', 'filter_auswahl_orga', '', 'string'));
//Filtering ausruestung
$this->setState('filter.ausruestung', $app->getUserStateFromRequest($this->context . '.filter.ausruestung', 'filter_ausruestung', '', 'string'));
//Filtering created_by
$this->setState('filter.created_by', $app->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '', 'string'));
// Load the parameters.
$params = JComponentHelper::getParams('com_einsatzkomponente');
$this->setState('params', $params);
// List state information.
parent::populateState('a.date1', 'desc');
}