Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 436 → Rev 437

/trunk/client/integrateur_wikini/integrateur_wikini.admin.php
New file
0,0 → 1,150
<?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 Lesser 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 |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser 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: integrateur_wikini.admin.php,v 1.1 2005-09-02 11:29:25 ddelon Exp $
/**
* Gestion des Wikini associé à un menu pour papyrus : lit et stocke les informations dans la
* champs gm_application_arguments de la table gen_menu
*
* Principe :
* Lecture arguments, decodage et affichage : Nom Wiki et Page Demarrage
* Affichage de l'ensemble des Wiki Disponible (avec leur page par Defaut)
* Choix d'un wiki
* Mise à jour
*
* TODO : gerer le defaut sur demmarage
*
* ------------ --------------
* Wiki : | | Page Principale : | |
* ------------ --------------
*
* Fragmenteur choix (selection uniquement)
*
* --------------------------------------
* | Nom Wiki | Page Demmarage |
* --------------------------------------
* | Wikini_01 | |
* ---------------------------------------
* | Wikini_02 | ChatMot |
* ---------------------------------------
*
* Valider - Annuler
*
*
*@package IntegrateurWikini
//Auteur original :
*@author David Delon <david.delon@clapas.net>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-09-02 11:29:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CLASSE |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclusion du fichier de configuration de cette application.*/
require_once 'client/integrateur_wikini/configuration/adwi_configuration.inc.php';
 
 
/** Inclusion de l'API de fonctions gérant les erreurs sql.*/
require_once ADWI_CHEMIN_BIBLIOTHEQUE_API.'debogage/BOG_sql.fonct.php';
 
require_once ADWI_CHEMIN_BIBLIOTHEQUE_API.'html/HTML_TableFragmenteur.php' ;
 
require_once ADWI_CHEMIN_BIBLIOTHEQUE.'adwi_wikini.fonct.php';
 
// Inclusion des fichiers de traduction de l'appli ADWI dePapyrus
if (file_exists(ADWI_CHEMIN_LANGUE.'adwi_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
require_once ADWI_CHEMIN_LANGUE.'adwi_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
} else {
/** Inclusion du fichier de traduction par défaut.*/
require_once ADWI_CHEMIN_LANGUE.'adwi_langue_'.ADWI_I18N_DEFAUT.'.inc.php';
}
 
 
class Integrateur_Wikini_Admin {
/** Fonction redigerContenu() - Affiche le formulaire de rédaction
*
*
* @return string Le HTML
*/
function afficherContenuCorps()
{
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
$url = $GLOBALS['_GEN_commun']['url'] ;
$auth = &$GLOBALS['_GEN_commun']['pear_auth'] ;
isset ($GLOBALS['action']) ? '' : $GLOBALS['action'] = '' ; // On déclare action si elle n'existe pas
if (!$auth->getAuth()) {
return 'Identifiez-vous' ;
}
// Comportement par défaut
// requete sur la table gen_wikini pour affichage de la liste des Wikini
$requete = "select gewi_id_wikini, gewi_code_alpha_wikini from gen_wikini" ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
$GLOBALS['_GEN_commun']['debogage_erreur']->gererErreur(E_USER_WARNING, "Echec de la requete : $requete<br />".$resultat->getMessage(),
__FILE__, __LINE__, 'admin_wikini') ;
return ;
}
$liste = new HTML_TableFragmenteur () ;
$liste->construireEntete(array (ADWI_NOM_WIKINI, ADWI_MODIFIER)) ;
$tableau_wikini = array() ;
while ($ligne = $resultat->fetchRow()) {
$url->addQueryString ('id_wikini', $ligne[0]) ;
array_push ($tableau_wikini, array ($ligne[1]."\n", // Première colonne, le nom de l'application
'<a href="'.$url->getURL().'">'.ADWI_MODIFIER.'</a>'."\n",
));
}
$liste->construireListe($tableau_wikini) ;
$res .= $liste->toHTML();
return $res ;
}
}// Fin de la classe
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>