Source for file select.php
Documentation is available at select.php
* @package Joomla.Administrator
* @subpackage com_modules
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* @subpackage com_modules
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
protected function populateState($ordering =
null, $direction =
null)
// Load the filter state.
$clientId =
$app->getUserState('com_modules.modules.filter.client_id', 0);
$this->setState('filter.client_id', (int)
$clientId);
// Manually set limits to get all modules.
$this->setState('list.ordering', 'a.name');
$this->setState('list.direction', 'ASC');
* Method to get a store id based on model configuration state.
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* @param string A prefix for the store id.
* @return string A store id.
$id .=
':' .
$this->getState('filter.client_id');
* Build an SQL query to load the list data.
// Create a new query object.
$query =
$db->getQuery(true);
// Select the required fields from the table.
'a.extension_id, a.name, a.element AS module'
$query->from($db->quoteName('#__extensions') .
' AS a');
$query->where('a.type = ' .
$db->quote('module'));
$clientId =
$this->getState('filter.client_id');
$query->where('a.client_id = ' . (int)
$clientId);
$query->where('a.enabled = 1');
// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.ordering')) .
' ' .
$db->escape($this->getState('list.direction', 'ASC')));
//echo nl2br(str_replace('#__','jos_',$query));
* Method to get a list of items.
* @return mixed An array of objects on success, false on failure.
// Get the list of items from the database.
// Loop through the results to add the XML metadata,
// and load language support.
foreach ($items as &$item)
$path =
JPath::clean($client->path .
'/modules/' .
$item->module .
'/' .
$item->module .
'.xml');
// 1.5 Format; Core files or language packs then
// 1.6 3PD Extension Support
$lang->load($item->module .
'.sys', $client->path, null, false, true)
||
$lang->load($item->module .
'.sys', $client->path .
'/modules/' .
$item->module, null, false, true);
$item->name =
JText::_($item->name);
if (isset
($item->xml) &&
$text =
trim($item->xml->description))
$item->desc =
JText::_($text);
$item->desc =
JText::_('COM_MODULES_NODESCRIPTION');
// TODO: Use the cached XML from the extensions table?
Documentation generated on Tue, 19 Nov 2013 15:12:48 +0100 by phpDocumentor 1.4.3