Source for file installed.php
Documentation is available at installed.php
* @package Joomla.Administrator
* @subpackage com_languages
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Languages Component Languages Model
* @package Joomla.Administrator
* @subpackage com_languages
* @var object client object
* @var object user object
* @var boolean|JExeptionTrue, if FTP settings should be shown, or an exeption
* @var string option name
* @var array languages description
* @var int total number pf languages
* @var int total number pf languages installed
* @var string language path
* 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->input->getInt('client');
$this->setState('filter.client_id', $clientId);
// List state information.
* 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 $id A prefix for the store id.
* @return string A store id.
$id .=
':'.
$this->getState('filter.client_id');
* Method to get the client object
* Method to get the ftp credentials
* Method to get the option
* Method to get Languages item data
// Compute all the languages
foreach ($langlist as $lang) {
$file =
$path .
'/' .
$lang .
'/' .
$lang.
'.xml';
foreach ($info as $key =>
$value)
// if current than set published
if ($params->get($client->name, 'en-GB') ==
$row->language)
usort($data, array($this, 'compareLanguages'));
$start =
$total -
$total %
$limit;
// Compute the displayed languages
for ($i =
$start;$i <
$end;$i++
)
$this->data[] =
& $data[$i];
* Method to get installed languages data.
* @return string An SQL query
// Create a new db object.
$query =
$db->getQuery(true);
$client =
$this->getState('filter.client_id');
// Select field element from the extensions table.
$query->select($this->getState('list.select', 'a.element'))
->from('#__extensions AS a');
$type =
$db->quote($type);
$query->where('(a.type = '.
$type.
')')
->where('client_id=' . (int)
$client);
// for client_id = 1 do we need to check language table also ?
* Method to get the total number of Languages items
* Method to set the default language
$params->set($client->name, $cid);
$id =
$table->find(array('element' =>
'com_languages'));
$table->params = (string)
$params;
// Clean the cache of com_languages and component cache.
* Method to get the folders
* @return array Languages folders
jimport('joomla.filesystem.folder');
$this->folders =
JFolder::folders($path, '.', false, false, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'pdf_fonts', 'overrides'));
* @return string The path to the languages folders
* Method to compare two languages in order to sort them
* @param object $lang1 the first language
* @param object $lang2 the second language
return strcmp($lang1->name, $lang2->name);
Documentation generated on Tue, 19 Nov 2013 15:05:40 +0100 by phpDocumentor 1.4.3