/** * Language Import * * @access public * @return void **/ public function languages() { /* INIT */ $vars = $this->getVars(); $output = array(); $errors = array(); /* Load the language file */ $this->registry->class_localization->loadLanguageFile(array('admin_system')); /* Get the language stuff */ require_once IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php'; $lang = new admin_core_languages_manage_languages($this->registry); $lang->makeRegistryShortcuts($this->registry); /* Loop through the xml directory and look for lang packs */ $_PATH = $this->app_full_path . '/xml/'; try { foreach (new DirectoryIterator($_PATH) as $f) { if (preg_match("#(.+?)_language_pack.xml#", $f->getFileName())) { $this->request['file_location'] = $_PATH . $f->getFileName(); $lang->imprtFromXML(true, true, true, $vars['app_directory']); } } } catch (Exception $e) { } $output[] = $this->registry->output->global_message ? $this->registry->output->global_message : $this->lang->words['redir__nolanguages']; /* Clear main msg */ $this->registry->output->global_message = ''; /* Show redirect... */ $this->showRedirectScreen($vars['app_directory'], $output, $errors, $this->getNextURL('tasks', $vars)); }
/** * Install Public Languages * * @return void */ public function install_client_languages() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous, '', $this->settings['gb_char_set']); /* Set up DB driver */ $extra_install = $this->_setUpDBDriver(FALSE); //----------------------------------------- // Install Languages //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Добавление языков"; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; //----------------------------------------- // Get the language stuff //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php'; /*noLibHook*/ $lang = new admin_core_languages_manage_languages(); $lang->makeRegistryShortcuts($this->registry); /* Loop through the xml directory and look for lang packs */ try { foreach (new DirectoryIterator($_PATH) as $f) { if (preg_match("#public_(.+?)_language_pack.xml#", $f->getFileName())) { //----------------------------------------- // Adjust the table? //----------------------------------------- if ($extra_install and method_exists($extra_install, 'before_inserts_run')) { $q = $extra_install->before_inserts_run('languages'); } //----------------------------------------- // Import and cache //----------------------------------------- $this->request['file_location'] = $_PATH . $f->getFileName(); $lang->imprtFromXML(true, true, true, $next['key'], false, 1); //----------------------------------------- // Adjust the table? //----------------------------------------- if ($extra_install and method_exists($extra_install, 'after_inserts_run')) { $q = $extra_install->after_inserts_run('languages'); } } } } catch (Exception $e) { } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Установка: Языки", 'install&do=clientlanguages&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "Добавление языков завершено"; $this->_finishStep($output, "Установка: Языки", 'install&do=bbcode'); } }
/** * Install Public Languages * * @return void */ public function install_client_languages() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous, '', $this->settings['gb_char_set']); //----------------------------------------- // Install Languages //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Обновление языков"; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; //----------------------------------------- // Get the language stuff //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php'; /*noLibHook*/ $lang = new admin_core_languages_manage_languages(); $lang->makeRegistryShortcuts($this->registry); /* Loop through the xml directory and look for lang packs */ try { foreach (new DirectoryIterator($_PATH) as $f) { // Check it's a valid file if (substr($f->getFileName(), 0, 1) === '.') { continue; } if (preg_match("#public_(.+?)_language_pack.xml#", $f->getFileName())) { //----------------------------------------- // Import and cache //----------------------------------------- $this->request['file_location'] = $_PATH . $f->getFileName(); $lang->imprtFromXML(true, true, true, $next['key'], true, 1); } } } catch (Exception $e) { } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Обновление: Языки", 'upgrade&do=clientlanguages&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "Языки обновлены"; $this->_finishStep($output, "Обновление: Языки", 'upgrade&do=bbcode'); } }
/** * Install Public Languages * * @return void */ public function install_client_languages() { //----------------------------------------- // INIT //----------------------------------------- $previous = $_REQUEST['previous']; //----------------------------------------- // Fetch next 'un //----------------------------------------- $next = IPSSetUp::fetchNextApplication($previous); //----------------------------------------- // Install Languages //----------------------------------------- if ($next['key']) { $output[] = $next['title'] . ": Upgrading Public languages..."; $_PATH = IPSLib::getAppDir($next['key']) . '/xml/'; //----------------------------------------- // Get the language stuff //----------------------------------------- require_once IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php'; $lang = new admin_core_languages_manage_languages(); $lang->makeRegistryShortcuts($this->registry); /* Loop through the xml directory and look for lang packs */ try { foreach (new DirectoryIterator($_PATH) as $f) { if (preg_match("#public_(.+?)_language_pack.xml#", $f->getFileName())) { //----------------------------------------- // Import and cache //----------------------------------------- $this->request['file_location'] = $_PATH . $f->getFileName(); $lang->imprtFromXML(true, true, true, $next['key']); } } } catch (Exception $e) { } //----------------------------------------- // Done.. so get some more! //----------------------------------------- $this->_finishStep($output, "Upgrade: Public Languages", 'upgrade&do=clientlanguages&previous=' . $next['key']); } else { //----------------------------------------- // Next... //----------------------------------------- $output[] = "All Public languages upgraded"; $this->_finishStep($output, "Upgrade: Public Languages", 'upgrade&do=bbcode'); } }