Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 289 → Rev 290

/trunk/papyrus/pap_rendu.inc.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: pap_rendu.inc.php,v 1.11 2005-02-28 11:20:42 jpm Exp $
// CVS : $Id: pap_rendu.inc.php,v 1.12 2005-03-02 11:04:36 jpm Exp $
/**
* Rendu : programme traitant l'url demandée et retournant la page compressé au navigateur.
*
35,7 → 35,7
*@author Alexandre GRANIER <alexadandre@tela-botanica.org>
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.11 $ $Date: 2005-02-28 11:20:42 $
*@version $Revision: 1.12 $ $Date: 2005-03-02 11:04:36 $
// +------------------------------------------------------------------------------------------------------+
*/
 
60,17 → 60,17
// Recherche du squelette de la page demandée.
 
// Ouverture du squelette
if (empty($_GEN_commun['info_menu']->gm_fichier_squelette)) {
if (isset($_GEN_commun['traduction_info_site'])) {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['traduction_info_site']->gs_fichier_squelette;
if (empty($GLOBALS['_GEN_commun']['info_menu']->gm_fichier_squelette)) {
if (isset($GLOBALS['_GEN_commun']['traduction_info_site'])) {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $GLOBALS['_GEN_commun']['traduction_info_site']->gs_fichier_squelette;
} else {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['info_site']->gs_fichier_squelette;
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $GLOBALS['_GEN_commun']['info_site']->gs_fichier_squelette;
}
} else {
if (isset($_GEN_commun['traduction_info_menu'])) {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['traduction_info_menu']->gs_fichier_squelette;
if (isset($GLOBALS['_GEN_commun']['traduction_info_menu'])) {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $GLOBALS['_GEN_commun']['traduction_info_menu']->gs_fichier_squelette;
} else {
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $_GEN_commun['info_menu']->gm_fichier_squelette;
$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'] = $GLOBALS['_GEN_commun']['info_menu']->gm_fichier_squelette;
}
}
// Si l'information concernant le chemin est réellement un chemin
77,8 → 77,8
if (! file_exists($GLOBALS['_PAPYRUS_']['general']['chemin_squelette'])) {
//Si ce n'est qu'un nom de fichier squelette
$GLOBALS['_PAPYRUS_']['general']['chemin_test'] = GEN_CHEMIN_SITES.
$_GEN_commun['info_site']->gs_code_alpha.'/'.
$_GEN_commun['i18n'].'/'.GEN_DOSSIER_SQUELETTE.'/'.$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'];
$GLOBALS['_GEN_commun']['info_site']->gs_code_alpha.'/'.
$GLOBALS['_GEN_commun']['i18n'].'/'.GEN_DOSSIER_SQUELETTE.'/'.$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'];
if (! file_exists($GLOBALS['_PAPYRUS_']['general']['chemin_test'])) {
die('ERREUR Papyrus : Impossible de trouver de fichier de squelette. <br />'.
'Chemin fichier squelette : '.$GLOBALS['_PAPYRUS_']['general']['chemin_squelette'].' <br />'.
107,21 → 107,21
// Recherche des informations pour la complétion de l'entête du squelette de la page demandée.
 
// Construction du titre.
if (! empty($_GEN_commun['info_menu']->gm_titre)) {
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_titre);
} else if (! empty($_GEN_commun['info_menu']->gm_titre_alternatif)) {
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_titre_alternatif);
if (! empty($GLOBALS['_GEN_commun']['info_menu']->gm_titre)) {
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_titre);
} else if (! empty($GLOBALS['_GEN_commun']['info_menu']->gm_titre_alternatif)) {
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_titre_alternatif);
} else {
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($_GEN_commun['info_menu']->gm_nom);
$GLOBALS['_PAPYRUS_']['page']['titre'] = htmlentities($GLOBALS['_GEN_commun']['info_menu']->gm_nom);
}
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $GLOBALS['_PAPYRUS_']['page']['titre'];
 
// Construction des infos sur le site
$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($_GEN_commun['info_site']->gs_nom);
$GLOBALS['_PAPYRUS_']['page']['nom_site'] = htmlentities($GLOBALS['_GEN_commun']['info_site']->gs_nom);
$GLOBALS['_PAPYRUS_']['rendu']['SITE_NOM'] = $GLOBALS['_PAPYRUS_']['page']['nom_site'];
$GLOBALS['_PAPYRUS_']['page']['langue_site'] = htmlentities($_GEN_commun['i18n']);
$GLOBALS['_PAPYRUS_']['page']['langue_site'] = htmlentities($GLOBALS['_GEN_commun']['i18n']);
$GLOBALS['_PAPYRUS_']['rendu']['SITE_LANGUE'] = $GLOBALS['_PAPYRUS_']['page']['langue_site'];
$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($_GEN_commun['info_site']->gs_code_alpha);
$GLOBALS['_PAPYRUS_']['page']['code_alpha_site'] = htmlentities($GLOBALS['_GEN_commun']['info_site']->gs_code_alpha);
$GLOBALS['_PAPYRUS_']['rendu']['SITE_CODE_ALPHA'] = $GLOBALS['_PAPYRUS_']['page']['code_alpha_site'];
 
// Construction des Meta "http-equiv".
206,9 → 206,9
 
// Construction des CSS
// Déclaration des constantes contenant les CSS à afficher sur la page.
$_GEN_commun['style_type'] = 'text/css';
$_GEN_commun['style_integree'] = '';
$_GEN_commun['style_externe'] = array();
$GLOBALS['_GEN_commun']['style_type'] = 'text/css';
$GLOBALS['_GEN_commun']['style_integree'] = '';
$GLOBALS['_GEN_commun']['style_externe'] = array();
if (GEN_DEBOGAGE) {
GEN_stockerStyleExterne('Débogage', GEN_CHEMIN_PAP.'presentations/css/debogage.css');
}
215,10 → 215,10
 
// Construction du Javascript
// Déclaration des constantes contenant le Javascript à afficher sur la page.
$_GEN_commun['script_type'] = 'text/javascript';
$_GEN_commun['script_code'] = '';
$_GEN_commun['script_fonction'] = array();
$_GEN_commun['script_fichier'] = array();
$GLOBALS['_GEN_commun']['script_type'] = 'text/javascript';
$GLOBALS['_GEN_commun']['script_code'] = '';
$GLOBALS['_GEN_commun']['script_fonction'] = array();
$GLOBALS['_GEN_commun']['script_fichier'] = array();
 
// +------------------------------------------------------------------------------------------------------+
// Gestion des inclusions des fichiers d'applettes
230,13 → 230,13
// Nous récupérons l'expression régulière de la balise pour l'utiliser lors de l'appel
// de la fonction de l'applette. L'appel des fonctions des applettes à lieu aprés l'appel
// de l'application pour permettre à l'appli de modifier certains paramêtres (identification, ordre des menus).
$_GEN_commun['info_applette'][$i]->applette_balise = $_GEN_commun['info_applette_balise'];
$_GEN_commun['info_applette'][$i]->applette_fonction = $_GEN_commun['info_applette_nom_fonction'];
$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_balise = $GLOBALS['_GEN_commun']['info_applette_balise'];
$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction = $GLOBALS['_GEN_commun']['info_applette_nom_fonction'];
} else {
// Ne devrait pas arréter le programme! Mais instancier le gestionnaire de déboguage.
die('ERREUR Papyrus : Impossible de trouver le fichier de l\'applette. <br />'.
'Nom applette : '.$_GEN_commun['info_applette'][$i]->gap_nom.' <br />'.
'Chemin fichier applette : '.$_GEN_commun['info_applette'][$i]->gap_chemin.' <br />'.
'Nom applette : '.$GLOBALS['_GEN_commun']['info_applette'][$i]->gap_nom.' <br />'.
'Chemin fichier applette : '.$GLOBALS['_GEN_commun']['info_applette'][$i]->gap_chemin.' <br />'.
'Ligne n° : '. __LINE__ .'<br />'.
'Fichier : '. __FILE__ );
}
248,8 → 248,8
// Une fois les applettes appelées est executées nous appelons l'application qui peut avoir
// besoins des infos des applettes (c'est le cas, pour l'applette IDENTIFICATION).
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = '';
if (isset($_GEN_commun['info_application']->gap_chemin)) {
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = $_GEN_commun['info_application']->gap_chemin;
if (isset($GLOBALS['_GEN_commun']['info_application']->gap_chemin)) {
$GLOBALS['_PAPYRUS_']['general']['application_chemin'] = $GLOBALS['_GEN_commun']['info_application']->gap_chemin;
}
 
// $application_chemin contient le chemin de l'application
298,44 → 298,45
 
// +------------------------------------------------------------------------------------------------------+
// Gestion de l'espace de nom pour les balise Papyrus
$_GEN_commun['balise_prefixe'] = 'PAPYRUS_';
$GLOBALS['_GEN_commun']['balise_prefixe'] = 'PAPYRUS_';
 
// +------------------------------------------------------------------------------------------------------+
// Gestion des appels des fonctions d'applettes
 
for ($i = 0; $i < count($_GEN_commun['info_applette']); $i++) {
for ($i = 0; $i < count($GLOBALS['_GEN_commun']['info_applette']); $i++) {
// Recherche du nombre de balise d'une applette donnée présentes dans le squelette
$GLOBALS['_PAPYRUS_']['applette']['nbr_balise'] = preg_match_all( '/<!-- '.$_GEN_commun['balise_prefixe'].'('.$_GEN_commun['info_applette'][$i]->applette_balise.') -->/',
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'],
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'],
PREG_SET_ORDER);
$GLOBALS['_PAPYRUS_']['applette']['nbr_balise'] = preg_match_all(
'/<!-- '.$GLOBALS['_GEN_commun']['balise_prefixe'].'('.$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_balise.') -->/',
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'],
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'],
PREG_SET_ORDER);
// Si on trouve au moins une balise, on lance la boucle pour les remplacer
for ($j = 0; $j <= ($GLOBALS['_PAPYRUS_']['applette']['nbr_balise'] - 1); $j++) {
// Nous vérifions que le nom de la fonction principale de l'applette existe.
if (function_exists($_GEN_commun['info_applette'][$i]->applette_fonction)) {
if (function_exists($GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction)) {
// Nous comptabilisons le nombre d'utilisation des applettes dans un squelette:
if (!isset($GLOBALS['_PAPYRUS_']['applette']['comptage'][$_GEN_commun['info_applette'][$i]->applette_fonction])) {
$GLOBALS['_PAPYRUS_']['applette']['comptage'][$_GEN_commun['info_applette'][$i]->applette_fonction] = 1;
if (!isset($GLOBALS['_PAPYRUS_']['applette']['comptage'][$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction])) {
$GLOBALS['_PAPYRUS_']['applette']['comptage'][$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction] = 1;
} else {
$GLOBALS['_PAPYRUS_']['applette']['comptage'][$_GEN_commun['info_applette'][$i]->applette_fonction]++;
$GLOBALS['_PAPYRUS_']['applette']['comptage'][$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction]++;
}
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'] =
call_user_func( $_GEN_commun['info_applette'][$i]->applette_fonction,
call_user_func( $GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction,
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j],
$_GEN_commun);
$GLOBALS['_GEN_commun']);
} else {
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'] =
'<!-- '."\n".
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' : '.
'fonction de l\'applette "'.$_GEN_commun['info_applette'][$i]->gap_nom.'" introuvable! '."\n".
'Fonction : '.$_GEN_commun['info_applette'][$i]->applette_fonction."\n".
' -->';
'<!-- '."\n".
$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' : '.
'fonction de l\'applette "'.$GLOBALS['_GEN_commun']['info_applette'][$i]->gap_nom.'" introuvable! '."\n".
'Fonction : '.$GLOBALS['_GEN_commun']['info_applette'][$i]->applette_fonction."\n".
' -->';
}
// Remplacement des balises d'applette de Génésia dans le squelette
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette'] =
str_replace( '<!-- '.$_GEN_commun['balise_prefixe'].$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' -->',
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'],
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette']);
str_replace( '<!-- '.$GLOBALS['_GEN_commun']['balise_prefixe'].$GLOBALS['_PAPYRUS_']['applette']['applet_arguments'][$j][1].' -->',
$GLOBALS['_PAPYRUS_']['applette']['contenu_applette'],
$GLOBALS['_PAPYRUS_']['general']['contenu_squelette']);
}
}
 
368,6 → 369,9
/* +--Fin du code ---------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.11 2005/02/28 11:20:42 jpm
* Modification des auteurs.
*
* Revision 1.10 2005/01/26 16:20:46 jpm
* Correction bogue meta : auteurs et mots-clés mélangés.
*