Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev Author Line No. Line
92 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.0                                                                                     |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eFlore-Serveur.                                                                 |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
108 jpm 24
// CVS : $Id: eribo_serveur.php,v 1.2 2005-01-24 17:42:54 jpm Exp $
92 jpm 25
/**
26
* Fichier principal d'eFlore-Serveur
27
*
28
* Ce fichier initialise le programme lance la recherche des infos et transfères les données
29
* à la vue demandée par l'action.
30
* Abréviation du programme : EFSE
31
*
32
*@package eFlore-Serveur
33
//Auteur original :
34
*@author        Frédéric LEGENS <flegens@free.fr>
35
//Autres auteurs :
36
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
37
*@copyright     Tela-Botanica 2000-2004
108 jpm 38
*@version       $Revision: 1.2 $ $Date: 2005-01-24 17:42:54 $
92 jpm 39
// +------------------------------------------------------------------------------------------------------+
40
*/
41
 
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                            ENTETE du PROGRAMME                                       |
44
// +------------------------------------------------------------------------------------------------------+
45
 
46
require_once 'configuration/eribo_config_avancee.inc.php';
47
require_once EFSE_FICHIER_CONFIG;
48
require_once EFSE_CHEMIN_INTERFACE.'eribo_modele.interface.php';
49
require_once EFSE_CHEMIN_INTERFACE.'eribo_vue.interface.php';
50
require_once EFSE_CHEMIN_INTERFACE.'eribo_macro_element.interface.php';
51
require_once EFSE_CHEMIN_CLASSE.'eribo_block.class.php';
52
require_once EFSE_CHEMIN_CLASSE.'eribo_collection_block.class.php';
53
require_once EFSE_CHEMIN_CLASSE.'eribo_groupe_macro_element.class.php';
54
require_once EFSE_CHEMIN_CLASSE.'eribo_macro_element.class.php';
55
 
56
// +------------------------------------------------------------------------------------------------------+
57
// |                                            CORPS du PROGRAMME                                        |
58
// +------------------------------------------------------------------------------------------------------+
108 jpm 59
$cle = $_REQUEST['cle'];
92 jpm 60
/* Lecture du fichier donnant la carte des services disponibles */
61
$fichier_services_map = fopen(EFSE_FICHIER_MAP, 'r');
62
while($donnee = fscanf($fichier_services_map, "%s\t%s\t%s\t%s\t%s\t%s", $cle_nom, $service_nom, $vue_nom, $schema, $ratio, $style)) {
63
    if ($cle == $cle_nom) {
64
        lancerService($service_nom, $vue_nom, $schema, $ratio, $style);
65
    }
66
}
67
fclose($fichier_services_map);
68
 
69
// +------------------------------------------------------------------------------------------------------+
70
// |                                           LISTE de FONCTIONS                                         |
71
// +------------------------------------------------------------------------------------------------------+
72
 
73
function lancerService($modele_nom, $vue_nom, $schema, $ratio, $style)
74
{
75
    $donnees_block = '';
76
    $un_modele = fabriquerModele($modele_nom);
77
    if ($un_modele != null) {
78
        $un_modele->construire();
79
        $donnees_block = $un_modele->recupererBlockDeDonnees();
80
    }
81
 
82
    $une_vue = fabriquerVue($vue_nom, $donnees_block);
83
    if ($une_vue != null) {
84
        $une_vue->serialiser();
85
    }
86
}
87
 
88
function fabriquerModele($modele_nom)
89
{
90
    require_once EFSE_CHEMIN_MV_MACRO_GROUPE.$modele_nom.'.php';
91
    $une_connexion = donnerConnexionBaseDeDonnees();
92
    $un_modele = new $modele_nom($une_connexion);
93
    return $un_modele;
94
}
95
 
96
function fabriquerVue($vue_nom, $donnees)
97
{
98
    require_once EFSE_CHEMIN_MV_VUE.$vue_nom.'.php';
99
    $une_vue = new $vue_nom($donnees);
100
    return $une_vue;
101
}
102
 
103
function donnerConnexionBaseDeDonnees() {
104
    if (!$link_id = mysql_connect(EFSE_BDD_SERVEUR, EFSE_BDD_UTILISATEUR, EFSE_BDD_MOT_DE_PASSE)) {
105
        echo '<ERREUR>';
106
        echo 'Impossible d\'établir de connexion à'.EFSE_BDD_SERVEUR;
107
        echo '</ERREUR>';
108
        exit(0);
109
    }
110
    mysql_select_db(EFSE_BDD_NOM, $link_id);
111
    return $link_id;
112
}
113
 
114
/* +--Fin du code ----------------------------------------------------------------------------------------+
115
*
116
* $Log: not supported by cvs2svn $
108 jpm 117
* Revision 1.1  2005/01/19 15:24:08  jpm
118
* Changement de nom.
119
*
92 jpm 120
* Revision 1.5  2005/01/19 15:23:43  jpm
121
* Changement de nom de fichiers.
122
*
123
* Revision 1.4  2004/12/22 13:32:33  jpm
124
* Inclusion des deux fichiers de config.
125
*
126
* Revision 1.3  2004/12/21 19:06:59  jpm
127
* Mise en conformité convention de codage.
128
*
129
* Revision 1.2  2004/12/16 22:07:35  fred
130
* correction du numéro de version de PHP
131
*
132
* Revision 1.1.1.1  2004/12/16 12:24:36  jpm
133
* Importation initiale eFlore v1.1 et serveur.
134
*
135
*
136
* +-- Fin du code ----------------------------------------------------------------------------------------+
137
*/
138
?>