MODX Revolution PHP Cross Reference Content Management Systems

Source: /setup/controllers/contexts.php - 64 lines - 4569 bytes - Text - Print

   1  <?php
   2  /**
   3   * @var modInstall $install
   4   * @var modInstallParser $parser
   5   * @var modInstallRequest $this
   6   * 
   7   * @package setup
   8   */
   9  $install->settings->check();
  10  if (!empty($_POST['proceed'])) {
  11      unset($_POST['proceed']);
  12      $webUrl= substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'setup/'));
  13  
  14      $_POST['context_web_path'] = !empty($_POST['context_web_path']) ? rtrim($_POST['context_web_path'],'/').'/' : MODX_INSTALL_PATH;
  15      $_POST['context_web_url'] = !empty($_POST['context_web_url']) ? rtrim($_POST['context_web_url'],'/').'/' : $webUrl;
  16      $_POST['context_mgr_path'] = !empty($_POST['context_mgr_path']) ? rtrim($_POST['context_mgr_path'],'/').'/' : MODX_INSTALL_PATH . 'manager/';
  17      $_POST['context_mgr_url'] = !empty($_POST['context_mgr_url']) ? rtrim($_POST['context_mgr_url'],'/').'/' : $webUrl . 'manager/';
  18      $_POST['context_connectors_path'] = !empty($_POST['context_connectors_path']) ? rtrim($_POST['context_connectors_path'],'/').'/' : MODX_INSTALL_PATH . 'connectors/';
  19      $_POST['context_connectors_url'] = !empty($_POST['context_connectors_url']) ? rtrim($_POST['context_connectors_url'],'/').'/' : $webUrl . 'connectors/';
  20      $install->settings->store($_POST);
  21  
  22      $settings = array();
  23      $settings['core_path'] = MODX_CORE_PATH;
  24      $settings['web_path_auto'] = isset ($_POST['context_web_path_toggle']) && $_POST['context_web_path_toggle'] ? 1 : 0;
  25      $settings['web_path'] = isset($_POST['context_web_path']) ? rtrim($_POST['context_web_path'],'/').'/' : MODX_INSTALL_PATH;
  26      $settings['web_url_auto'] = isset ($_POST['context_web_url_toggle']) && $_POST['context_web_url_toggle'] ? 1 : 0;
  27      $settings['web_url'] = isset($_POST['context_web_url']) ? rtrim($_POST['context_web_url'],'/').'/' : $webUrl;
  28      $settings['mgr_path_auto'] = isset ($_POST['context_mgr_path_toggle']) && $_POST['context_mgr_path_toggle'] ? 1 : 0;
  29      $settings['mgr_path'] = isset($_POST['context_mgr_path']) ? rtrim($_POST['context_mgr_path'],'/').'/' : MODX_INSTALL_PATH . 'manager/';
  30      $settings['mgr_url_auto'] = isset ($_POST['context_mgr_url_toggle']) && $_POST['context_mgr_url_toggle'] ? 1 : 0;
  31      $settings['mgr_url'] = isset($_POST['context_mgr_url']) ? rtrim($_POST['context_mgr_url'],'/').'/' : $webUrl . 'manager/';
  32      $settings['connectors_path_auto'] = isset ($_POST['context_connectors_path_toggle']) && $_POST['context_connectors_path_toggle'] ? 1 : 0;
  33      $settings['connectors_path'] = isset($_POST['context_connectors_path']) ? rtrim($_POST['context_connectors_path'],'/').'/' : MODX_INSTALL_PATH . 'connectors/';
  34      $settings['connectors_url_auto'] = isset ($_POST['context_connectors_url_toggle']) && $_POST['context_connectors_url_toggle'] ? 1 : 0;
  35      $settings['connectors_url'] = isset($_POST['context_connectors_url']) ? rtrim($_POST['context_connectors_url'],'/').'/' : $webUrl . 'connectors/';
  36      $settings['processors_path'] = MODX_CORE_PATH . 'model/modx/processors/';
  37      $settings['assets_path'] = $settings['web_path'] . 'assets/';
  38      $settings['assets_url'] = $settings['web_url'] . 'assets/';
  39      $install->settings->store($settings);
  40  
  41      $this->proceed('summary');
  42  }
  43  $mode = $install->settings->get('installmode');
  44  
  45  $webUrl= substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], 'setup/'));
  46  if ($mode == modInstall::MODE_UPGRADE_REVO || $mode == modInstall::MODE_UPGRADE_REVO_ADVANCED) {
  47      include MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
  48  
  49      $parser->set('context_web_path', defined('MODX_BASE_PATH') ? MODX_BASE_PATH : MODX_INSTALL_PATH);
  50      $parser->set('context_web_url', defined('MODX_BASE_URL') ? MODX_BASE_URL : $webUrl);
  51      $parser->set('context_connectors_path', defined('MODX_CONNECTORS_PATH') ? MODX_CONNECTORS_PATH : MODX_INSTALL_PATH . 'connectors/');
  52      $parser->set('context_connectors_url', defined('MODX_CONNECTORS_URL') ? MODX_CONNECTORS_URL : $webUrl . 'connectors/');
  53      $parser->set('context_mgr_path', defined('MODX_MANAGER_PATH') ? MODX_MANAGER_PATH : MODX_INSTALL_PATH . 'manager/');
  54      $parser->set('context_mgr_url', defined('MODX_MANAGER_URL') ? MODX_MANAGER_URL : $webUrl . 'manager/');
  55  } else {
  56      $parser->set('context_web_path', MODX_INSTALL_PATH);
  57      $parser->set('context_web_url', $webUrl);
  58      $parser->set('context_connectors_path', MODX_INSTALL_PATH . 'connectors/');
  59      $parser->set('context_connectors_url', $webUrl . 'connectors/');
  60      $parser->set('context_mgr_path', MODX_INSTALL_PATH . 'manager/');
  61      $parser->set('context_mgr_url', $webUrl . 'manager/');
  62  }
  63  
  64  return $parser->render('contexts.tpl');

title

Description

title

Description

title

Description

title

title

Body