New file |
0,0 → 1,179 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library 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.1 of the License, or (at your option) any later version. | |
// | | |
// | This library 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 this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: projet.php,v 1.1 2005-09-22 14:02:48 ddelon Exp $ |
/** |
* Application projet |
* |
* Fichier d'appel pour papyrus |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
include_once 'configuration/projet.config.inc.php' ; |
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ; |
|
// Inclusion des styles selon papyrus |
if (function_exists("GEN_stockerStyleExterne")) { |
GEN_stockerStyleExterne('projet','client/projet/projet.css') ; |
GEN_stockerStyleExterne('projet_arbre','client/projet/arbre.css') ; |
} |
|
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE des constantes | |
// +------------------------------------------------------------------------------------------------------+ |
|
define ("PROJET_DEFAUT", 1) ; |
define ("PROJET_VOIR", 2) ; |
define ('PROJET_MENU_AFFICHER_CONTENU_CORPS', 1) ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
|
if (isset($_REQUEST[PROJET_VARIABLE_ID_PROJET])) { |
function afficherContenuNavigation () { |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ID_PROJET, $_REQUEST[PROJET_VARIABLE_ID_PROJET]) ; |
if (empty($_REQUEST[PROJET_VARIABLE_ACTION])) { |
$_REQUEST[PROJET_VARIABLE_ACTION] = PROJET_ACTION_VOIR_RESUME ; |
} |
$res = '' ; |
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && $GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre') { |
$res .= '<ul class="onglets">'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_RESUME); |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_RESUME).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_SYNTHESE.'</a></li>'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DESCRIPTION); |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_DESCRIPTION).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_DESCRIPTION.'</a></li>'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_WIKINI); |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_WIKINI).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_WIKINI.'</a></li>'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ; |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_DOCUMENT).'"><a href="'.$GLOBALS['url']->getURL().'">Documents</a></li>'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ; |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_FORUM).'"><a href="'.$GLOBALS['url']->getURL().'">Forum</a></li>'; |
$GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ; |
$res .= '<li class="'.cma(PROJET_ACTION_VOIR_PARTICIPANT).'"><a href="'.$GLOBALS['url']->getURL().'">Participants</a></li>'; |
$res .= '</ul>'; |
$GLOBALS['url']->removeQueryString (PROJET_VARIABLE_ACTION) ; |
} |
return $res ; |
} |
} |
|
function afficherContenuMenu() |
{ |
$sortie = ''; |
// on fait de même pour id_projet |
$id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : ''; |
|
// On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut |
$action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT; |
|
// et pour id_repertoire |
$id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : ''; |
|
$controleur = new projetControleur($GLOBALS['projet_db'], $GLOBALS['projet_auth'], $GLOBALS['url']) ; |
|
if ($id_projet != '' && projet::projetExiste($GLOBALS['projet_db'], $id_projet)) { |
$controleur->setIdProjet($id_projet) ; |
} |
if ($id_repertoire != "") { |
$controleur->setIdRepertoire($id_repertoire) ; |
} |
|
// Dans le cas de la présentation par arbre, on met les menus |
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && $GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre') { |
$sortie .= $controleur->menuGeneral() ; |
} |
return $sortie; |
} |
|
function afficherContenuCorps() { |
|
// On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut |
$action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT; |
|
// on fait de même pour id_projet |
$id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : ''; |
|
// et pour id_repertoire |
$id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : ''; |
|
// et pour id_document |
$id_document = isset($_REQUEST['id_document']) ? $_REQUEST['id_document'] : ''; |
|
// On construit le controleur en lui passant en paramètre l'identifiant de connexion à la BD |
// l'objet d'authentification et l'url de la page |
|
$controleur = new projetControleur(&$GLOBALS['projet_db'], &$GLOBALS['projet_auth'], &$GLOBALS['url']) ; |
$controleur->setAction ($action) ; |
|
// On indique au controleur sur quel projet on travaille |
|
if ($id_projet != "") { |
$controleur->setIdProjet($id_projet) ; |
|
} |
if ($id_repertoire != "") { |
$controleur->setIdRepertoire($id_repertoire) ; |
} |
if ($id_document != "") { |
$controleur->setIdDocument($id_document) ; |
} |
|
// récupération des paramètres de l'appli |
if (isset($GLOBALS['_GEN_commun']['info_application']->presentation)) { |
$controleur->setPresentation($GLOBALS['_GEN_commun']['info_application']->presentation) ; |
} |
|
$res = $controleur->run() ; |
$GLOBALS['chrono_flash']['apres_doc'] = microtime() ; |
return $res ; |
} |
|
/** cma() calcule menu actif |
* |
* |
* @return |
*/ |
|
function cma ($var) { |
$class = $_REQUEST[PROJET_VARIABLE_ACTION] == $var ? 'menu_actif' : 'menu_inactif' ; |
return $class ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
|
|
?> |