Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 57 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
57 jpm 1
<?php
52 fred 2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
58 jpm 4
// | PHP version 5.0.3                                                                                    |
52 fred 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
// +------------------------------------------------------------------------------------------------------+
24
//
25
/**
26
* Fichier principal du generateur d'eFlore-Serveur
27
*
28
* Ce fichier presente les macro-elements, groupes de macro-elements, ainsi que
29
* la map des services disponibles et permet de lancer leurs
30
* traductions en php
31
* Abréviation du programme : EFSE
32
*
33
*@package eFlore-Serveur
34
//Auteur original :
35
*@author        Frédéric LEGENS <flegens@free.fr>
36
//Autres auteurs :
37
*@author        Aucun
38
*@copyright     Tela-Botanica 2000-2004
58 jpm 39
*@version       $Revision: 1.3 $ $Date: 2004-12-23 15:45:48 $
52 fred 40
// +------------------------------------------------------------------------------------------------------+
41
*/
42
 
43
// +------------------------------------------------------------------------------------------------------+
44
// |                                            ENTETE du PROGRAMME                                       |
45
// +------------------------------------------------------------------------------------------------------+
46
 
57 jpm 47
require_once '../configuration/eflore_config.php';
48
require_once '../configuration/eflore_config_avancee.inc.php';
49
header("Content-type: application/vnd.mozilla.xul+xml");
50
echo '<?xml version="1.0" encoding="UTF-8" ?>';
51
echo '<?xml-stylesheet href="css/style.css" type="text/css"?>';
52 fred 52
 
53
// +------------------------------------------------------------------------------------------------------+
54
// |                                            CORPS du PROGRAMME                                        |
55
// +------------------------------------------------------------------------------------------------------+
56
?>
57
<!DOCTYPE window>
58
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1">
59
    <script type="application/x-javascript" src="eflore_editeur.js" />
60
    <!-- <script type="application/x-javascript" src="eflore_generateur.js" /> -->
57 jpm 61
     <vbox flex="1">
62
         <tree  id="composants" hidecolumnpicker="true" flex="1" ondblclick="afficherSelection('composants','src','editeur');">
63
             <treecols>
64
                 <treecol id="name" label="Elements" flex="1" primary="true"/>
65
             </treecols>
66
             <treechildren>
67
                 <treeitem container="true">
68
                     <treerow><treecell label="Groupes" src="generateur.html"/></treerow>
69
                     <treechildren>
70
                     <? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE,'groupes_macro_elements'); ?>
71
                     </treechildren>
72
                 </treeitem>
73
                 <treeitem container="true">
74
                     <treerow><treecell label="Macroelements" src="generateur.html"/></treerow>
75
                     <treechildren>
76
                     <? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO,'macro_elements'); ?>
77
                     </treechildren>
78
                 </treeitem>
79
                 <treeitem container="true">
80
                     <treerow><treecell label="Map" src="generateur.html"/></treerow>
81
                     <treechildren></treechildren>
82
                 </treeitem>
83
             </treechildren>
84
         </tree>
52 fred 85
        <button label="Compiler macroelements" onclick="compileSelection('listemacroelements')"/>
57 jpm 86
          <button label="Compiler groupes"  onclick="compileSelection('groupesmacroelements')"/>
87
      </vbox>
52 fred 88
</window>
57 jpm 89
<?php
52 fred 90
// +------------------------------------------------------------------------------------------------------+
91
// |                                           LISTE de FONCTIONS                                         |
57 jpm 92
// +------------------------------------------------------------------------------------------------------+
93
function ecrirelisteFichier($chemin, $type)
94
{
95
    $repertoire = openDir($chemin);
96
    while ($fichier = readDir($repertoire)) {
97
        if (($fichier != '.') && ($fichier != '..') && ($fichier != 'CVS')) {
98
            echo '<treeitem><treerow>';
99
            echo '<treecell label="'.$fichier.'" src="../definitions/'.$type.'/'.$fichier.'"/>';
100
            echo '</treerow></treeitem>';
101
        }
102
    }
103
    closeDir($repertoire);
104
}
105
 
106
function ecrireFichierMap()
107
{
108
    $fichierServicesMap = fopen('..\\'.$appConfig['service_map'], 'r');
109
    $ligne = 0;
110
    while($donnee = fscanf($fichierServicesMap,"%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) {
111
        $ligne++;
112
        if ($ligne > 1) {
113
            echo    '<listitem><listcell label="'.$keyName.'"/><listcell label="'.$serviceName.'"/>'.
114
                    '<listcell label="'.$viewName.'"/><listcell label="'.$schema.'"/><listcell label="'.$ratio.'"/>'.
115
                    '<listcell label="'.$style.'"/></listitem>';
116
        }
117
    }
118
    fclose($fichierServicesMap);
119
}
120
 
52 fred 121
/* +--Fin du code ----------------------------------------------------------------------------------------+
122
*
123
* $Log: not supported by cvs2svn $
58 jpm 124
* Revision 1.2  2004/12/23 15:43:37  jpm
125
* Mise en conformité convention de codage.
126
*
57 jpm 127
* Revision 1.1  2004/12/22 23:28:47  fred
128
* création de l'éditeur
52 fred 129
*
57 jpm 130
*
52 fred 131
* +-- Fin du code ----------------------------------------------------------------------------------------+
132
*/
57 jpm 133
?>