Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 50 → Rev 51

/trunk/serveur/generateur/eflore_generateur.php
1,79 → 1,146
<?php
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.0 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore-Serveur. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
//
/**
* Fichier principal du generateur d'eFlore-Serveur
*
* Ce fichier presente les macro-elements, groupes de macro-elements, ainsi que
* la map des services disponibles et permet de lancer leurs
* traductions en php
* Abréviation du programme : EFSE
*
*@package eFlore-Serveur
//Auteur original :
*@author Frédéric LEGENS <flegens@free.fr>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $ $Date: 2004-12-22 23:29:01 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once '../configuration/eflore_config.php';
 
header('Content-type: application/vnd.mozilla.xul+xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
echo '<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>';
 
function ecrirelisteFichier($chemin)
{
$repertoire = openDir($chemin);
while ($fichier = readDir($repertoire)) {
if (($fichier !='.') && ($fichier !='..')) {
echo "<listitem label='$fichier'/>";
}
}
closeDir($repertoire);
}
 
function ecrireFichierMap()
{
$fichierServicesMap = fopen(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_FICHIER_MAP, 'r');
$ligne = 0;
while($donnee=fscanf($fichierServicesMap,"%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) {
$ligne++;
if ($ligne>1) {
echo "<listitem><listcell label='$keyName'/><listcell label='$serviceName'/><listcell label='$viewName'/><listcell label='$schema'/><listcell label='$ratio'/><listcell label='$style'/></listitem>";
}
}
fclose($fichierServicesMap);
}
?>
 
<!DOCTYPE window>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<script type="application/x-javascript" src="eflore_generateur.js" />
<hbox flex="1">
<vbox flex="1">
<label value="Macro Elements"/>
<listbox id="listemacroelements">
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO); ?>
</listbox>
<hbox>
<button label="Tout compiler" onclick="compileSelection('listemacroelements')"/>
<button label="Afficher" onclick="afficheSelection('listemacroelements')"/>
</hbox>
</vbox>
<vbox flex="1">
<label value="Service Donnees"/>
<listbox id="groupesmacroelements">
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE); ?>
</listbox>
<hbox>
<button label="Tout compiler" onclick="compileSelection('groupesmacroelements')"/>
<button label="Afficher" onclick="afficheSelection('groupesmacroelements')"/>
</hbox>
</vbox>
<vbox flex="1">
<label value="Publications HTML"/>
<listbox>
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_PUBLI_XHTML); ?>
</listbox>
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox>
</vbox>
<vbox flex="1">
<label value="Publications XML"/>
<listbox>
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_PUBLI_XML); ?>
</listbox>
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox>
</vbox>
</hbox>
<hbox flex="1" >
<listbox flex="1">
<listcols><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /></listcols>
<listhead><listheader label="Clef"/><listheader label="Service"/><listheader label="Publication"/><listheader label="Schema a respecter"/><listheader label="Ratio de control"/><listheader label="Style"/></listhead>
<? ecrireFichierMap(); ?>
</listbox>
</hbox>
</window>
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
header('Content-type: application/vnd.mozilla.xul+xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
echo '<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>'
 
?>
 
<!DOCTYPE window>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<script type="application/x-javascript" src="eflore_generateur.js" />
<hbox flex="1">
<vbox flex="1">
<label value="Macro Elements"/>
<listbox id="listemacroelements">
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO); ?>
</listbox>
<hbox>
<button label="Tout compiler" onclick="compileSelection('listemacroelements')"/>
<button label="Afficher" onclick="afficheSelection('listemacroelements')"/>
</hbox>
</vbox>
<vbox flex="1">
<label value="Service Donnees"/>
<listbox id="groupesmacroelements">
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE); ?>
</listbox>
<hbox>
<button label="Tout compiler" onclick="compileSelection('groupesmacroelements')"/>
<button label="Afficher" onclick="afficheSelection('groupesmacroelements')"/>
</hbox>
</vbox>
<!--
<vbox flex="1">
<label value="Publications HTML"/>
<listbox>
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_PUBLI_XHTML); ?>
</listbox>
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox>
</vbox>
<vbox flex="1">
<label value="Publications XML"/>
<listbox>
<? ecrireListeFichier(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_PUBLI_XML); ?>
</listbox>
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox>
</vbox>
-->
</hbox>
<hbox flex="1" >
<listbox flex="1">
<listcols><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /></listcols>
<listhead><listheader label="Clef"/><listheader label="Service"/><listheader label="Publication"/><listheader label="Schema a respecter"/><listheader label="Ratio de control"/><listheader label="Style"/></listhead>
<? ecrireFichierMap(); ?>
</listbox>
</hbox>
</window>
 
<?
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
function ecrirelisteFichier($chemin)
{
$repertoire = openDir($chemin);
while ($fichier = readDir($repertoire)) {
if (($fichier !='.') && ($fichier !='..')) {
echo "<listitem label='$fichier'/>";
}
}
closeDir($repertoire);
}
 
function ecrireFichierMap()
{
$fichierServicesMap = fopen(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_FICHIER_MAP, 'r');
$ligne = 0;
while($donnee=fscanf($fichierServicesMap,"%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) {
$ligne++;
if ($ligne>1) {
echo "<listitem><listcell label='$keyName'/><listcell label='$serviceName'/><listcell label='$viewName'/><listcell label='$schema'/><listcell label='$ratio'/><listcell label='$style'/></listitem>";
}
}
fclose($fichierServicesMap);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>