Line 19... |
Line 19... |
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | |
|
22 |
// | |
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
24 |
// CVS : $Id: pap_initialise_info.inc.php,v 1.25 2006-10-11 18:04:11 jp_milcent Exp $
|
24 |
// CVS : $Id: pap_initialise_info.inc.php,v 1.26 2006-10-18 10:18:05 jp_milcent Exp $
|
25 |
/**
|
25 |
/**
|
26 |
*Initialisation de Papyrus : vérification et récupération de paramètres généraux.
|
26 |
*Initialisation de Papyrus : vérification et récupération de paramètres généraux.
|
27 |
*
|
27 |
*
|
28 |
* La page contient le code initialisant l'éxecution du rendu d'une page par Papyrus.
|
28 |
* La page contient le code initialisant l'éxecution du rendu d'une page par Papyrus.
|
29 |
* Nous y trouvons la recherche des informations disponibles sur :
|
29 |
* Nous y trouvons la recherche des informations disponibles sur :
|
Line 39... |
Line 39... |
39 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
39 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
40 |
//Autres auteurs :
|
40 |
//Autres auteurs :
|
41 |
*@author Alexandre GRANIER <alex@tela-botanica.org>
|
41 |
*@author Alexandre GRANIER <alex@tela-botanica.org>
|
42 |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr>
|
42 |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr>
|
43 |
*@copyright Tela-Botanica 2000-2004
|
43 |
*@copyright Tela-Botanica 2000-2004
|
44 |
*@version $Revision: 1.25 $ $Date: 2006-10-11 18:04:11 $
|
44 |
*@version $Revision: 1.26 $ $Date: 2006-10-18 10:18:05 $
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
46 |
*/
|
46 |
*/
|
Line 47... |
Line 47... |
47 |
|
47 |
|
48 |
// +------------------------------------------------------------------------------------------------------+
|
48 |
// +------------------------------------------------------------------------------------------------------+
|
Line 62... |
Line 62... |
62 |
// +------------------------------------------------------------------------------------------------------+
|
62 |
// +------------------------------------------------------------------------------------------------------+
|
63 |
// | CORPS du PROGRAMME |
|
63 |
// | CORPS du PROGRAMME |
|
64 |
// +------------------------------------------------------------------------------------------------------+
|
64 |
// +------------------------------------------------------------------------------------------------------+
|
65 |
// +------------------------------------------------------------------------------------------------------+
|
65 |
// +------------------------------------------------------------------------------------------------------+
|
66 |
// Gestion de la réecriture d'url et des url erreur 404
|
66 |
// Gestion de la réecriture d'url et des url erreur 404
|
67 |
if ((! isset($_GET[GEN_URL_CLE_SITE]) || empty($_GET[GEN_URL_CLE_SITE])) && (! isset($_GET[GEN_URL_CLE_MENU]) || empty($_GET[GEN_URL_CLE_MENU])) ) {
|
67 |
if ((defined('PAP_URL_REECRITURE') AND PAP_URL_REECRITURE == '1' && (! isset($_GET[GEN_URL_CLE_SITE]) || empty($_GET[GEN_URL_CLE_SITE])) && (! isset($_GET[GEN_URL_CLE_MENU]) || empty($_GET[GEN_URL_CLE_MENU]))) ) {
|
68 |
if (defined('PAP_URL_REECRITURE') AND PAP_URL_REECRITURE == '1') {
|
- |
|
69 |
$tab_type_reecriture = array('MENU', 'SITE');
|
68 |
$tab_type_reecriture = array('MENU', 'SITE');
|
70 |
foreach ($tab_type_reecriture as $reecriture) {
|
69 |
foreach ($tab_type_reecriture as $reecriture) {
|
71 |
if (PAP_URL_REECRITURE_SEP == '/') {
|
70 |
if (PAP_URL_REECRITURE_SEP == '/') {
|
72 |
$masque_reecriture = '/^(\/.*?)'.constant('PAP_URL_REECRITURE_'.$reecriture).'\\'.PAP_URL_REECRITURE_SEP.'([^\/]+?)(?:\?(.*)|)$/';
|
71 |
$masque_reecriture = '/^(\/.*?)'.constant('PAP_URL_REECRITURE_'.$reecriture).'\\'.PAP_URL_REECRITURE_SEP.'([^\/]+?)(?:\?(.*)|)$/';
|
73 |
} else {
|
72 |
} else {
|
Line 102... |
Line 101... |
102 |
}
|
101 |
}
|
103 |
}
|
102 |
}
|
104 |
}
|
103 |
}
|
105 |
}
|
104 |
}
|
Line 106... |
Line -... |
106 |
|
- |
|
107 |
// Aucune information n'a été trouvée, redirection vers la page de gestion des erreurs 404
|
- |
|
108 |
if ((! isset($_GET[GEN_URL_CLE_SITE]) || empty($_GET[GEN_URL_CLE_SITE])) && (! isset($_GET[GEN_URL_CLE_MENU]) || empty($_GET[GEN_URL_CLE_MENU]))) {
|
- |
|
109 |
// Utilisation de la fonction statique de Pear HTTP pour négocier l'i18n.
|
- |
|
110 |
$aso_i18n_possible = array(GEN_I18N_ID_DEFAUT => true);
|
- |
|
111 |
$i18n = HTTP::negotiateLanguage($aso_i18n_possible, GEN_I18N_ID_DEFAUT);
|
- |
|
112 |
if (file_exists(sprintf(PAP_FICHIER_ERREUR_404, $i18n))) {
|
- |
|
113 |
header ('Location: '.sprintf(PAP_URL_ERREUR_404, $chemin_vers_papyrus, $i18n, $_SERVER['REQUEST_URI']));
|
- |
|
114 |
} else {
|
- |
|
115 |
header('Location: /');
|
- |
|
116 |
}
|
- |
|
117 |
exit(0);
|
- |
|
118 |
}
|
- |
|
119 |
}
|
- |
|
120 |
|
105 |
|
121 |
// +------------------------------------------------------------------------------------------------------+
|
106 |
// +------------------------------------------------------------------------------------------------------+
|
122 |
// Gestion des sites : disponibles sur le serveur courant.
|
107 |
// Gestion des sites : disponibles sur le serveur courant.
|
123 |
// Liste des catégories de site à prendre en compte :
|
108 |
// Liste des catégories de site à prendre en compte :
|
124 |
// Pas de site, ni de menu dans l'URL, recherche du site par défaut
|
109 |
// Pas de site, ni de menu dans l'URL, recherche du site par défaut
|
Line 495... |
Line 480... |
495 |
$_GEN_commun['url']->addQueryString(GEN_URL_CLE_FORMAT, $_GEN_commun['url_format']);
|
480 |
$_GEN_commun['url']->addQueryString(GEN_URL_CLE_FORMAT, $_GEN_commun['url_format']);
|
496 |
}
|
481 |
}
|
Line 497... |
Line 482... |
497 |
|
482 |
|
498 |
/* +--Fin du code ---------------------------------------------------------------------------------------+
|
483 |
/* +--Fin du code ---------------------------------------------------------------------------------------+
|
- |
|
484 |
* $Log: not supported by cvs2svn $
|
- |
|
485 |
* Revision 1.25 2006/10/11 18:04:11 jp_milcent
|
- |
|
486 |
* Gestion avancée de la réecriture d'URL.
|
499 |
* $Log: not supported by cvs2svn $
|
487 |
*
|
500 |
* Revision 1.24 2006/03/02 10:49:49 ddelon
|
488 |
* Revision 1.24 2006/03/02 10:49:49 ddelon
|
501 |
* Fusion branche multilinguisme dans branche principale
|
489 |
* Fusion branche multilinguisme dans branche principale
|
502 |
*
|
490 |
*
|
503 |
* Revision 1.23.2.2 2005/12/20 14:40:24 ddelon
|
491 |
* Revision 1.23.2.2 2005/12/20 14:40:24 ddelon
|