示例#1
0
 protected function _initExternals()
 {
     $eExpert = $this->_getExternalsExpert();
     if (!$eExpert->hasExternals()) {
         return;
     }
     /*
      * Register external classes
      */
     $classes = $eExpert->getClasses();
     if (!empty($classes)) {
         $this->_autoloader->addMap($classes);
     }
     /*
      * Register external objects
      */
     $objects = $eExpert->getObjects();
     if (!empty($objects)) {
         Db_Object_Config::registerConfigs($objects);
     }
     $curLang = $this->_config->get('language');
     /*
      * Register external translations
      */
     $translations = $eExpert->getTranslations($curLang);
     if (!empty($translations)) {
         Db_Object_Config::getTranslator()->addTranslations($translations);
     }
     $dictionaries = $eExpert->getDictionaries();
     if (!empty($dictionaries)) {
         Dictionary::addExternal($dictionaries);
     }
     $langs = $eExpert->getLangs($curLang);
     if (!empty($langs)) {
         foreach ($langs as $name => $path) {
             Lang::addDictionaryLoader($name, $path, Config::File_Array);
         }
     }
     /*
      * Inject Externals Expert
      */
     $page = Page::getInstance()->setExternalsExpert($eExpert);
 }