/**
  * Installs Settings schematic
  *
  * @return void
  */
 public function install_settings()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $previous = $_REQUEST['previous'];
     //-----------------------------------------
     // Fetch next 'un
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous, '{app}_settings.xml', $this->settings['gb_char_set']);
     //-----------------------------------------
     // Install settings
     //-----------------------------------------
     if ($next['key']) {
         $output[] = $next['title'] . ": Обновление настроек";
         $_PATH = IPSLib::getAppDir($next['key']) . '/xml/';
         if (is_file($_PATH . $next['key'] . '_settings.xml')) {
             //-----------------------------------------
             // Continue
             //-----------------------------------------
             require_once IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php';
             /*noLibHook*/
             $settings = new admin_core_settings_settings();
             $settings->makeRegistryShortcuts($this->registry);
             $this->request['app_dir'] = $next['key'];
             //-----------------------------------------
             // Known settings
             //-----------------------------------------
             if (substr(IPSSetUp::getSavedData('install_url'), -1) == '/') {
                 IPSSetUp::setSavedData('install_url', substr(IPSSetUp::getSavedData('install_url'), 0, -1));
             }
             if (substr(IPSSetUp::getSavedData('install_dir'), -1) == '/') {
                 IPSSetUp::setSavedData('install_dir', substr(IPSSetUp::getSavedData('install_dir'), 0, -1));
             }
             /* Fetch known settings  */
             $knownSettings = array();
             if (is_file(IPSLib::getAppDir($next['key']) . '/setup/versions/install/knownSettings.php')) {
                 require IPSLib::getAppDir($next['key']) . '/setup/versions/install/knownSettings.php';
                 /*noLibHook*/
             }
             $settings->importAllSettings(1, 1, $knownSettings);
         }
         //-----------------------------------------
         // Done.. so get some more!
         //-----------------------------------------
         $this->_finishStep($output, "Обновление: Настройки для " . $next['title'], 'upgrade&do=settings&previous=' . $next['key']);
     } else {
         //-----------------------------------------
         // Next...
         //-----------------------------------------
         $output[] = "Все настройки обновлены";
         $this->_finishStep($output, "Обновление: Настройки", 'upgrade&do=templates');
     }
 }
 /**
  * Installs Settings schematic
  *
  * @return void
  */
 public function install_settings()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $previous = $_REQUEST['previous'];
     //-----------------------------------------
     // Fetch next 'un
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous, '{app}_settings.xml', $this->settings['gb_char_set']);
     /* Set up DB driver */
     $extra_install = $this->_setUpDBDriver(FALSE);
     //-----------------------------------------
     // Install settings
     //-----------------------------------------
     if ($next['key']) {
         $output[] = $next['title'] . ": Добавление настроек";
         $_PATH = IPSLib::getAppDir($next['key']) . '/xml/';
         $knownSettings = array();
         if (is_file($_PATH . $next['key'] . '_settings.xml')) {
             //-----------------------------------------
             // Adjust the table?
             //-----------------------------------------
             if ($extra_install and method_exists($extra_install, 'before_inserts_run')) {
                 $q = $extra_install->before_inserts_run('settings');
             }
             //-----------------------------------------
             // Continue
             //-----------------------------------------
             require_once IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php';
             /*noLibHook*/
             $settings = new admin_core_settings_settings();
             $settings->makeRegistryShortcuts($this->registry);
             $this->request['app_dir'] = $next['key'];
             //-----------------------------------------
             // Known settings
             //-----------------------------------------
             if (substr(IPSSetUp::getSavedData('install_url'), -1) == '/') {
                 IPSSetUp::setSavedData('install_url', substr(IPSSetUp::getSavedData('install_url'), 0, -1));
             }
             if (substr(IPSSetUp::getSavedData('install_dir'), -1) == '/') {
                 IPSSetUp::setSavedData('install_dir', substr(IPSSetUp::getSavedData('install_dir'), 0, -1));
             }
             /* Fetch known settings  */
             if (is_file(IPSLib::getAppDir($next['key']) . '/setup/versions/install/knownSettings.php')) {
                 require IPSLib::getAppDir($next['key']) . '/setup/versions/install/knownSettings.php';
                 /*noLibHook*/
             }
             $this->request['app_dir'] = $next['key'];
             $settings->importAllSettings(1, 1, $knownSettings);
             //-----------------------------------------
             // Adjust the table?
             //-----------------------------------------
             if ($extra_install and method_exists($extra_install, 'after_inserts_run')) {
                 $q = $extra_install->after_inserts_run('settings');
             }
         }
         //-----------------------------------------
         // Done.. so get some more!
         //-----------------------------------------
         $this->_finishStep($output, "Установка: Настройки", 'install&do=settings&previous=' . $next['key']);
     } else {
         //-----------------------------------------
         // Next...
         //-----------------------------------------
         $output[] = "Настройки добавлены";
         $this->_finishStep($output, "Установка: Настройки", 'install&do=templates');
     }
 }