Skip to content

Commit

Permalink
Dev: Add a check/uncheck all for restricted language
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Jun 22, 2015
1 parent dd9c86c commit 31fb8d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions application/views/admin/globalSettings_view.php
Expand Up @@ -630,6 +630,13 @@
$aLanguages[$sLanguage]=html_entity_decode($aLanguage['description'], ENT_QUOTES, 'UTF-8')." (".html_entity_decode($aLanguage['nativedescription'], ENT_QUOTES, 'UTF-8').")";
}
$aAvailableLang=getLanguageDataRestricted ();
// Help for restrictToLanguages is a checkbox select all
$sScriptAllLanguage="$(document).on('click','#restrictToLanguages_select_all',function(e){\n"
. " if($(this).is(':checked')) { $('#restrictToLanguages > option').attr('selected','selected'); }\n"
. " else { $('#restrictToLanguages > option').removeAttr('selected'); }\n"
. " $('#restrictToLanguages').trigger('change');\n"
. "});\n";
App()->clientScript->registerScript('sScriptAllLanguage', $sScriptAllLanguage,CClientScript::POS_END);
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'language',
'form' => false,
Expand All @@ -652,6 +659,7 @@
'restrictToLanguages'=>array(
'type'=>'select',
'label'=>gT("Available languages").$sStringDemoMode,
'help'=>CHtml::label(gt("Check/Uncheck All"),"restrictToLanguages_select_all").CHtml::checkBox('restrictToLanguages_select_all',count($aLanguages)==count($aAvailableLang)),
'options'=>$aLanguages,
'current'=>array_keys(getLanguageDataRestricted ()),
'htmlOptions'=>array(
Expand Down

0 comments on commit 31fb8d7

Please sign in to comment.