示例#1
0
 /**
  * @param CM_Model_Language $language
  */
 public function __construct(CM_Model_Language $language)
 {
     $translations = array();
     foreach (new CM_Paging_Translation_Language($language, null, null, null, true) as $translation) {
         $translations[$translation['key']] = $language->getTranslation($translation['key']);
     }
     $this->_content = 'cm.language.setAll(' . CM_Params::encode($translations, true) . ');';
 }
示例#2
0
 /**
  * @param CM_Site_Abstract  $site
  * @param bool|null         $debug
  * @param CM_Model_Language $language
  */
 public function __construct(CM_Site_Abstract $site, $debug = null, CM_Model_Language $language)
 {
     parent::__construct($site, $debug);
     $translations = array();
     foreach ($language->getTranslations(true) as $translation) {
         $translations[$translation['key']] = $language->getTranslation($translation['key']);
     }
     $this->_js->append('cm.language.setAll(' . CM_Params::encode($translations, true) . ');');
 }