/trunk/serveur/generateur/eflore_generateur.php |
---|
1,146 → 1,79 |
<?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 | |
// +------------------------------------------------------------------------------------------------------+ |
<?php |
require_once '../configuration/eflore_config.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | 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 ----------------------------------------------------------------------------------------+ |
*/ |
?> |
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> |
/trunk/serveur/generateur/eflore_traducteur.php |
---|
1,129 → 1,67 |
<? |
/*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 de traduction des définitions en php. |
* |
* Ce fichier permet de transformer la définition d'un macro-element ou d'un |
* groupe de macro-elements en code 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.2 $ $Date: 2004-12-22 23:29:15 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once '../configuration/eflore_config.php'; |
require_once '../configuration/eflore_config_avancee.inc.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
if(!empty($_REQUEST['listemacroelements'])) |
{ |
genererTousMacroElements(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO); |
//genererTousMacroElements('..\\'.$appConfig['def_macro']); |
} |
if(!empty($_REQUEST['groupesmacroelements'])) |
{ |
genererTousGroupesMacroElements(EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE); |
//genererTousGroupesMacroElements('..\\'.$appConfig['def_groupes']); |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
function genererTousGroupesMacroElements($chemin) |
{ |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..') && ($fichier!='CVS')) |
{ |
echo "<li>$fichier début de la génération"; |
$res=EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_MV_MACRO_GROUPE.$fichier.'.php'; |
genererFichier('xslt\groupemacroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererTousMacroElements($chemin) |
{ |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..') && ($fichier!='CVS')) |
{ |
echo "<li>$fichier début de la génération"; |
$res=EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_MV_MACRO.$fichier.'.php'; |
genererFichier('xslt\macroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererFichier($xsltFilePath,$xmlFilePath,$resFilePath) |
{ |
$processeur = new XSLTprocessor(); |
$style = new domDocument(); |
$style->load($xsltFilePath); |
$processeur->importStyleSheet($style); |
$doc = new domDocument(); |
$doc->load($xmlFilePath); |
$handle = fopen ($resFilePath, "w"); |
fwrite($handle,$processeur->transformToXML($doc)); |
fclose($handle); |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
<? |
require_once '..\\eflore_config.php'; |
if(!empty($_REQUEST['listemacroelements'])) |
{ |
genererTousMacroElements('..\\'.$appConfig['def_macro']); |
} |
if(!empty($_REQUEST['groupesmacroelements'])) |
{ |
genererTousGroupesMacroElements('..\\'.$appConfig['def_groupes']); |
} |
function genererTousGroupesMacroElements($chemin) |
{ |
global $appConfig; |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..')) |
{ |
echo "<li>$fichier début de la génération"; |
$res='..\\'.$appConfig['auto_groupes'].$fichier.'.php'; |
genererFichier('xslt\groupemacroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererTousMacroElements($chemin) |
{ |
global $appConfig; |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..')) |
{ |
echo "<li>$fichier début de la génération"; |
$res='..\\'.$appConfig['auto_macro'].$fichier.'.php'; |
genererFichier('xslt\macroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererFichier($xsltFilePath,$xmlFilePath,$resFilePath) |
{ |
$processeur = new XSLTprocessor(); |
$style = new domDocument(); |
$style->load($xsltFilePath); |
$processeur->importStyleSheet($style); |
$doc = new domDocument(); |
$doc->load($xmlFilePath); |
$handle = fopen ($resFilePath, "w"); |
fwrite($handle,$processeur->transformToXML($doc)); |
fclose($handle); |
} |
?> |
/trunk/serveur/generateur/eflore_afficher.php |
---|
1,85 → 1,21 |
<?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 permmetant d'afficher les sources. |
* |
* Ce fichier permet d'afficher le code source d'un macro-element ou d'un groupe |
* de macro-elements |
* |
* 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:28:14 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once '../configuration/eflore_config.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
header('Content-type: text/xml'); |
if(!empty($_REQUEST['listemacroelements'])) { |
$nom = EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO.$_REQUEST['listemacroelements']; |
$file = fopen($nom, 'r'); |
$taille = fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
if(!empty($_REQUEST['groupesmacroelements'])) { |
$nom = EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE.$_REQUEST['groupesmacroelements']; |
$file = fopen($nom, 'r'); |
$taille = fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
<?php |
require_once '../configuration/eflore_config.php'; |
header('Content-type: text/xml'); |
if(!empty($_REQUEST['listemacroelements'])) { |
$nom = EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO.$_REQUEST['listemacroelements']; |
$file = fopen($nom, 'r'); |
$taille = fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
if(!empty($_REQUEST['groupesmacroelements'])) { |
$nom = EFSE_CHEMIN_GENERATEUR_RACINE.EFSE_CHEMIN_DEF_MACRO_GROUPE.$_REQUEST['groupesmacroelements']; |
$file = fopen($nom, 'r'); |
$taille = fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
?> |