Subversion Repositories Applications.gtt

Compare Revisions

Regard whitespace Rev 8 → Rev 9

/trunk/index.php
42,7 → 42,7
include_once 'gtt_config.inc.php';
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
include_once CHEMIN_CLASSES.'gtt_authentification.php';
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
include_once CHEMIN_PRESENTATION.'gtt_fonctions_generique_affichage.php';
 
// Création du dsn
// Connexion a la base de donnees
50,7 → 50,7
 
if (DB::isError($GLOBALS['db'])) {
$GLOBALS['db']->getMessage();
echo "echec connexion a la base de donnees";
echo "Echec connexion a la base de donnees";
}
 
$params = array("dsn"=>$GLOBALS['dsn'],
73,9 → 73,33
$GLOBALS['idCurrentUser'] = $utilisateur;
// Récuperation de l'identifiant de la personne
// Test des choix de menu a afficher
if (empty($action)) {
$action = 1 ;
if (!empty($_GET['action'])) {
$action = $_GET['action'];
}
if (!preg_match('/^\d+$/', $action)) {
// Utilisation du mécanisme MVC avec Squelette PHP et objet
require_once GTT_CHEMIN_CLASSE.'Controlleur.class.php';
require_once GTT_CHEMIN_CLASSE.'aAction.class.php';
require_once GTT_CHEMIN_CLASSE.'Resultat.class.php';
$module = 'Preference';
if (isset($_GET['module']) && !empty($_GET['module'])) {
$module = $_GET['module'];
}
$nom_module = 'GttControlleur'.$module;
$fichier_module = GTT_CHEMIN_MODULE.$nom_module.'.class.php';
$nom_module_general = 'Controlleur';
$fichier_module_general = GTT_CHEMIN_CLASSE.$nom_module_general.'.class.php';
if (file_exists($fichier_module)) {
require_once $fichier_module;
$Controlleur = new $nom_module;
} else if (file_exists($fichier_module_general)) {
require_once $fichier_module_general;
$Controlleur = new $nom_module_general;
}
echo $Controlleur->executer($action);
} else {
// Utilisation de l'ancien mécanisme
switch ($action) {
// Cas affichage menu travail 1
case GESTION_TRAVAIL :
155,6 → 179,7
}
$text .= fermerBalisesFin();
echo $text;
}
} else {
echo afficherMenuConnexion();
}