Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion component/admin/models/fields/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class JFormFieldLanguage extends JFormFieldList
*/
protected function getOptions()
{
$app = JFactory::getApplication();
$state = $app->getUserState('com_localise.select');
$attributes = '';

if ($v = (string) $this->element['onchange'])
Expand All @@ -58,7 +60,24 @@ protected function getOptions()
$install = array();
}

$languages = array_merge($admin, $site, $install);
// Listing languages in the language filter depending on the client filter
if ($state['client'] == 'installation')
{
$languages = $install;
}
elseif ($state['client'] == 'administrator')
{
$languages = $admin;
}
elseif ($state['client'] == 'site')
{
$languages = $site;
}
else
{
$languages = array_merge($admin, $site, $install);
}

$attributes .= ' class="' . (string) $this->element['class'] . ($this->value == $reference ? ' iconlist-16-reference"' : '"');

foreach ($languages as $i => $language)
Expand Down