$localeTitle) { if( ($allowedLocales && !in_array($locale, $allowedLocales)) || ($excludeLocales && in_array($locale, $excludeLocales)) || ($usedLocalesWithTitle && array_key_exists($locale, $usedLocalesWithTitle)) ) { unset($allLocalesWithTitle[$locale]); } } // instance specific permissions foreach($allLocalesWithTitle as $locale => $localeTitle) { if($instance && !$instance->canTranslate(null, $locale)) { unset($allLocalesWithTitle[$locale]); } } foreach($usedLocalesWithTitle as $locale => $localeTitle) { if($instance && !$instance->canTranslate(null, $locale)) { unset($usedLocalesWithTitle[$locale]); } } // Sort by title (array value) asort($allLocalesWithTitle); if(count($usedLocalesWithTitle)) { asort($usedLocalesWithTitle); $source = array( _t('Form.LANGAVAIL', "Available languages") => $usedLocalesWithTitle, _t('Form.LANGAOTHER', "Other languages") => $allLocalesWithTitle ); } else { $source = $allLocalesWithTitle; } parent::__construct($name, $title, $source); } } ?>