Subversion Repositories Applications.papyrus

Rev

Rev 1988 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 jpm 1
<?php
2061 aurelien 2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
6 jpm 3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library 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 GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
1970 aperonnet 22
// CVS : $Id: installateur.php,v 1.17 2008-11-19 09:25:36 aperonnet Exp $
6 jpm 23
/**
24
* Application Installateur de Papyrus.
25
*
2061 aurelien 26
* Application permettant de gérer l'installation et les erreurs liés à l'abscence de base de données,
6 jpm 27
* d'extenssin PHP...
28
*
29
*@package Installateur
30
//Auteur original :
1970 aperonnet 31
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
6 jpm 32
//Autres auteurs :
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2004
1970 aperonnet 35
*@version       $Revision: 1.17 $ $Date: 2008-11-19 09:25:36 $
6 jpm 36
// +------------------------------------------------------------------------------------------------------+
37
**/
38
 
2061 aurelien 39
 
40
if(GEN_VERSION == PAP_VERSION) {
41
	header('location:papyrus.php');
42
	exit;
43
}
6 jpm 44
// +------------------------------------------------------------------------------------------------------+
45
// |                                            ENTÊTE du PROGRAMME                                       |
46
// +------------------------------------------------------------------------------------------------------+
458 florian 47
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable...
48
preg_match('/^(.*)papyrus.php/', $_SERVER['SCRIPT_FILENAME'], $instal_tab_txt);
49
define('INSTAL_CHEMIN_ABSOLU', $instal_tab_txt[1]);
50
/** Nom du dossier contenant l'application Installateur.*/
51
define('INSTAL_DOSSIER_APPLI', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_APPLICATION.'installateur'.GEN_SEP);
52
/** Nom du dossier contenant la bibliothèque de code de l'application Installateur.*/
53
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque'.GEN_SEP);
54
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
55
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.GEN_FICHIER_CONFIG);
56
/** Nom du fichier de configuration de Papyrus à créer.*/
57
define('INSTAL_FICHIER_CONFIG', GEN_FICHIER_CONFIG);
58
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
59
define('INSTAL_CHEMIN_SQL', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_INSTAL);
60
/** Nom de la constante stockant le numéro de la nouvelle version de l'application Papyrus.*/
61
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
62
/** Numéro de la nouvelle version de l'application Papyrus.*/
63
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION);
64
if (defined('PAP_VERSION')) {
65
    define('INSTAL_VERSION_ANCIENNE', PAP_VERSION);
66
} else {
67
    define('INSTAL_VERSION_ANCIENNE', '');
68
}
69
/** Nombre d'étapes totale de l'installation.*/
70
define('INSTAL_NBRE_ETAPE', 3);
6 jpm 71
 
458 florian 72
// Fichiers à inclure
73
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
74
 
6 jpm 75
// +------------------------------------------------------------------------------------------------------+
76
// |                                          CORPS du PROGRAMME                                          |
77
// +------------------------------------------------------------------------------------------------------+
2061 aurelien 78
function afficherContenuCorps()
458 florian 79
{
1362 florian 80
    // Entête XHTML des pages de l'installation de Papyrus
458 florian 81
    $sortie = '';
82
    $sortie .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n";
83
    $sortie .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
84
    $sortie .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">'."\n";
85
    $sortie .= '  <head>'."\n";
86
    $sortie .= '    <link rel="stylesheet" type="text/css" media="screen" title="Installateur" href="papyrus/applications/installateur/presentations/styles/installateur.css" />'."\n";
87
    $sortie .= '    <title>Installation de Papyrus</title>'."\n";
88
    $sortie .= '  </head>'."\n";
986 florian 89
 	$sortie .= '  <body xml:lang="fr" lang="fr" >'."\n";
90
	$sortie .= '  <div id="page">'."\n";
2061 aurelien 91
    $sortie .= '  	<div id="zone_bandeau">'."\n";
92
	$sortie .= '  		<div id="logo">'."\n";
986 florian 93
    $sortie .= '              <img src="papyrus/applications/installateur/presentations/images/Logo_papyrus.jpg" alt="Logo Papyrus" />'."\n";
458 florian 94
    $sortie .= '        </div>'."\n";
95
    $sortie .= '        <div id="site_nom">'."\n";
96
    $sortie .= '          <h1>Installation de Papyrus</h1>'."\n";
97
    $sortie .= '        </div>'."\n";
98
    $sortie .= '      </div>'."\n";
99
    $sortie .= '      <div id="zone_contenu">'."\n";
100
    // Message situation de l'installation
101
    if (defined('PAP_VERSION')) {
993 florian 102
        $sortie .=  '<p class="zone_info">Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
458 florian 103
                    INSTAL_VERSION_ANCIENNE.'.<br />'.
993 florian 104
                    'Vous &ecirc;tes sur le point de <strong>mettre &agrave; jour</strong> Papyrus pour la version '.
458 florian 105
                    INSTAL_VERSION_NOUVELLE.'.<br />'.
993 florian 106
                    'Veuillez revoir vos informations de configuration ci-dessous.</p><br style="clear:both;">'."\n";
458 florian 107
    } else {
993 florian 108
        $sortie .=  '<p class="zone_info">Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
1362 florian 109
                    'Veuillez configurer votre Papyrus en remplissant les formulaires &eacute;tape par &eacute;tape.</p><br style="clear:both;">'."\n";
458 florian 110
    }
2061 aurelien 111
 
458 florian 112
    if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
113
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
114
    } else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
115
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
116
    } else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
117
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
118
    }
2061 aurelien 119
 
458 florian 120
    // Pied XHTML des pages de l'installation de Papyrus
121
    $sortie .= '    </div>'."\n";
122
    $sortie .= '      <div id="zone_pied">'."\n";
990 florian 123
    $sortie .= '       <div id="copyright">'."\n";
458 florian 124
    $sortie .= '        <a href="http://frenchmozilla.org"><img src="papyrus/applications/installateur/presentations/images/logo-firefox.png" alt="Logo Firefox" /></a>&nbsp;'."\n";
125
    $sortie .= '        <a href="http://validator.w3.org/check?uri=referer"><img src="papyrus/applications/installateur/presentations/images/logo-xhtml11.png" alt="Logo XHTML" /></a>&nbsp;'."\n";
126
    $sortie .= '        <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="papyrus/applications/installateur/presentations/images/logo-css.png" alt="Logo CSS" /></a><br />'."\n";
1362 florian 127
    $sortie .= '        &copy;&nbsp;<a href="http://www.tela-botanica.org/">Tela Botanica</a> et  <a href="http://www.ecole-et-nature.org/">R&eacute;seau Ecole et Nature</a> / 2004-2006<br />'."\n";
990 florian 128
    $sortie .= '        Site utilisant <a href="http://outils-reseaux.org/wiki_papyrus">Papyrus, le CMS coop&eacute;ratif</a>'."\n";
129
    $sortie .= '       </div>'."\n";
458 florian 130
    $sortie .= '      </div>'."\n";
131
    $sortie .= '  </div>'."\n";
132
    $sortie .= ' </body>'."\n";
133
    $sortie .= '</html>';
2061 aurelien 134
 
458 florian 135
    return $sortie;
136
}
1024 ddelon 137
 
138
 
6 jpm 139
// +------------------------------------------------------------------------------------------------------+
140
// |                                            PIED du PROGRAMME                                         |
458 florian 141
// +------------------------------------------------------------------------------------------------------+
6 jpm 142
 
143
/* +--Fin du code ----------------------------------------------------------------------------------------+
144
*
986 florian 145
* $Log: not supported by cvs2svn $
1970 aperonnet 146
* Revision 1.16  2007-04-20 13:31:42  florian
147
* remplacement des caracteres speciaux par des entite html
148
*
1362 florian 149
* Revision 1.15  2006/10/16 15:49:07  ddelon
150
* Refactorisation code mulitlinguisme et gestion menu invisibles
151
*
1033 ddelon 152
* Revision 1.14  2006/10/09 14:35:50  ddelon
153
* bug caractere invalide trainant dans fichier
154
*
1024 ddelon 155
* Revision 1.13  2006/10/05 15:17:29  florian
156
* changement presentation
157
*
993 florian 158
* Revision 1.12  2006/10/05 15:11:17  florian
159
* changement presentation
160
*
990 florian 161
* Revision 1.11  2006/10/05 14:41:53  florian
162
* changement presentation
163
*
986 florian 164
* Revision 1.10  2005/09/23 14:20:23  florian
165
* nouvel habillage installateur, plus correction de quelques bugs
166
*
458 florian 167
* Revision 1.9  2004/10/27 11:43:32  jpm
168
* Correction bogues diff mise à jour / installation.
6 jpm 169
*
458 florian 170
* Revision 1.8  2004/10/25 10:22:48  jpm
171
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
172
*
173
* Revision 1.7  2004/10/22 17:23:04  jpm
174
* Simplification del'installation de Papyrus.
175
*
176
* Revision 1.6  2004/10/19 17:01:12  jpm
177
* Correction bogues.
178
*
179
* Revision 1.5  2004/10/19 16:47:28  jpm
180
* Transformation en fonction de l'appel de l'application.
181
*
182
* Revision 1.4  2004/10/19 15:59:18  jpm
183
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
184
* Ajout des constantes FTP.
185
*
186
* Revision 1.3  2004/10/18 09:12:09  jpm
187
* Changement de nom d'un fichier.
188
*
189
* Revision 1.2  2004/10/15 18:28:59  jpm
190
* Début appli installateur de Papyrus.
191
*
192
* Revision 1.1  2004/06/16 14:33:13  jpm
1362 florian 193
* Changement de nom de Papyrus en Papyrus.
458 florian 194
* Changement de l'arborescence.
195
*
196
* Revision 1.6  2004/04/22 08:25:48  jpm
197
* Transformation de $GS_GLOBAL en $_GEN_commun.
198
*
6 jpm 199
* Revision 1.5  2004/04/08 13:21:05  jpm
200
* Le code pour l'installation uniquement.
201
*
202
* Revision 1.4  2004/04/08 12:25:16  jpm
1362 florian 203
* Suppression de tous le code réalisant les vérifications. L'application Installateur ne fera qu'installer Papyrus et non vérifier son bon fonctionnement.
6 jpm 204
*
205
* Revision 1.3  2004/04/02 16:37:51  jpm
206
* Modification des commentaires.
207
*
208
* Revision 1.2  2004/03/31 16:57:16  jpm
209
* Ajout de la gestion des erreur de base de données, de la connexion à celle-ci et des extenssions php disponibles.
210
*
211
* Revision 1.1  2004/03/29 11:00:12  jpm
1362 florian 212
* Transfert d'un morceau de code gérant les erreurs et l'installation mais qui a actuellement aucun effet sur Papyrus.
6 jpm 213
*
214
*
215
* +-- Fin du code ----------------------------------------------------------------------------------------+
216
*/
217
?>