[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/install/ -> index.php (source)

   1  <?php
   2  /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
   3  /*
   4  # ***** BEGIN LICENSE BLOCK *****
   5  # This file is part of Plume CMS, a website management application.
   6  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   7  #
   8  # Plume CMS is free software; you can redistribute it and/or modify
   9  # it under the terms of the GNU General Public License as published by
  10  # the Free Software Foundation; either version 2 of the License, or
  11  # (at your option) any later version.
  12  #
  13  # Plume CMS is distributed in the hope that it will be useful,
  14  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  # GNU General Public License for more details.
  17  #
  18  # You should have received a copy of the GNU General Public License
  19  # along with this program; if not, write to the Free Software
  20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  21  #
  22  # ***** END LICENSE BLOCK ***** */
  23  
  24  require_once dirname(__FILE__).'/prepend.php';
  25  
  26  $_px_p = 0; //percentage of wizard done.
  27  
  28  /**
  29   * Overview of the steps.
  30   *
  31   * 1- Choose language for installation and/or interface -> go to 9bis if update
  32   * 2- Check
  33   * 3- Choose encoding if needed and language for the interface
  34   * 4- Database info
  35   * 5- Database install
  36   * 6- First user
  37   * 7- First website
  38   * 8- First post
  39   * 9- Secure installer
  40   * 9bis- Update
  41   * 10- Go to the admin
  42   */
  43  
  44  $installer_langs = l10n::getAvailableLocales('', 'install');
  45  $install_lang = l10n::getAcceptedLanguage($installer_langs);
  46  $encoding = '';
  47  $update = false;
  48  //Check if a global config file is available
  49  if (file_exists($_PX_config['manager_path'].'/conf/config.php')) {
  50      include_once $_PX_config['manager_path'].'/conf/config.php';
  51      //overwrite install lang
  52      $install_lang = $_PX_config['lang'];
  53      $encoding = $_PX_config['encoding'];
  54      $update = true;
  55      $_SESSION['step1'] = true;
  56  }
  57  
  58  //Check if language selected.
  59  
  60  if (!empty($_POST['lang'])) {
  61      if (in_array($_POST['lang'], $installer_langs)) {
  62          $_SESSION['encoding'] = 'utf-8';
  63          $_SESSION['lang'] = $_POST['lang'];
  64          $_SESSION['step1'] = true;
  65          header('Location: check.php');
  66          exit;
  67      }
  68  }
  69  
  70  //load the language file
  71  $_PX_config['encoding'] = 'utf-8';
  72  
  73  $l = new l10n($install_lang, 'install');
  74  
  75  //Populate the list of languages
  76  $isocodes = $l->getIsoCodes();
  77  $langs = array();
  78  reset($installer_langs);
  79  foreach ($installer_langs as $iso) {
  80      $langs[$isocodes[$iso]] = $iso;
  81  }
  82  
  83  include dirname(__FILE__).'/_top.php';
  84  
  85  
  86  echo '<h2>'.__('Welcome on the PLUME CMS installation').'</h2>'."\n\n";
  87  
  88  if ($update) {
  89      if (strtolower($encoding) == 'iso-8859-1') {
  90          echo '<p>'.__('<strong>Warning</strong>, the upgrade will convert your installation from iso-8859-1 to utf-8, please perform a backup of your database.').'</p>';
  91  
  92      }
  93      echo '<p>'.sprintf(__('A possible previous installation of PLUME CMS is detected. You are invited to <a href="%s">upgrade your installation</a>.'), 'upgrade.php').'</p>';
  94  } else {
  95      echo '<p>'.__('Please choose the language of the installation wizard.').'</p>'."\n\n";
  96      ?>
  97      <form action="index.php" method="post" id="formPost">
  98          <p class="field">
  99          <label class="float" for="lang" style="display:inline"><?php  echo __('Language:'); ?></label>
 100          <?php echo form::combobox('lang', $langs, $install_lang);  ?>
 101          <input name="next" type="submit" class="submit" value="<?php  echo __('Next'); ?>"  accesskey="n" />
 102            </p>
 103      </form>
 104      <?php
 105  }
 106  
 107  include dirname(__FILE__).'/_bottom.php';
 108  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics