/branches/v3.0-aha/papyrus/applications/admin_application/langues/adap_langue_fr.inc.php |
---|
New file |
0,0 → 1,74 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar 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 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar 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 Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: adap_langue_fr.inc.php,v 1.4 2006-12-01 10:39:14 alexandre_tb Exp $ |
/** |
* Gestion des langues de l'application ADME |
* |
* Contient les constantes pour la langue française de l'application ADAP. |
* |
*@package Admin_appli |
*@subpackage Langues |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE des CONSTANTES | |
// +------------------------------------------------------------------------------------------------------+ |
define ('ADAP_NOM_APPL', 'Nom de l\'application') ; |
define ('ADAP_MODIFIER', 'Modifier') ; |
define ('ADAP_SUPPRIMER', 'Supprimer') ; |
define ('ADAP_AJOUTER', 'Ajouter une application') ; |
define ('ADAP_NOM_APPL_ALERTE', 'Vous devez spécifier un nom') ; |
define ('ADAP_CHAMPS_REQUIS', 'Indique les champs requis') ; |
define ('ADAP_DESCRIPTION', 'Description') ; |
define ('ADAP_IDENTIFIEZ_VOUS','Veuillez vous identifier pour accèder à ce menu.'); |
define ('ADAP_CHEMIN', 'Chemin vers l\'application') ; |
define ('ADAP_CHEMIN_REQUIS', 'Le chemin vers l\'application est requis') ; |
define ('ADAP_APPLETTE', 'L\'application est elle une applette') ; |
define ('ADAP_ANNULER', 'Annuler') ; |
define ('ADAP_VALIDER', 'Valider') ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2006/10/06 10:40:51 florian |
* harmonisation des messages d'erreur de l'authentification |
* |
* Revision 1.2 2005/03/09 10:40:37 alex |
* version initiale |
* |
* Revision 1.1 2004/12/13 18:07:38 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/branches/v3.0-aha/papyrus/applications/admin_application/admin_application.php |
---|
New file |
0,0 → 1,210 |
<?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: admin_application.php,v 1.9 2007-08-28 14:02:06 jp_milcent Exp $ |
/** |
* Application gérant les applications de Papyrus |
* |
* Cette application permet de gérer les applications de papyrus |
* elle permet de spécifier pour un monde quel annuaire utiliser |
* et de gérer des authentifications de spip et ou wikini |
* |
*@package Admin_auth |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.9 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once GEN_CHEMIN_PAP.'applications/admin_application/configuration/adap_configuration.inc.php'; |
//Utilisation de la bibliothèque PEAR NET_URL |
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php'; |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm/select.php'; |
/** Inclusion de l'API de fonctions gérant les erreurs sql.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_API.'debogage/BOG_sql.fonct.php'; |
/** Inclusion des fonctions de manipulation du sql. |
* Permet la récupération d'un nouvel identifiant d'une table.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_API.'sql/SQL_manipulation.fonct.php'; |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_API.'html/HTML_TableFragmenteur.php' ; |
/** <BR> Inclusion de la bibliothèque de fonctions concernant les tables "gen_site..." de Papyrus.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_GEN.'pap_site.fonct.php'; |
/** <BR> Inclusion de la bibliothèque de fonctions concernant les tables "gen_menu..." de Papyrus.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_GEN.'pap_menu.fonct.php'; |
/** <BR> Inclusion de la bibliothèque de fonctions concernant les tables "gen_applications..." de Papyrus.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE_GEN.'pap_application.fonct.php'; |
/** <BR> Inclusion de la bibliothèque de fonctions concernant l'affichage commun.*/ |
require_once ADAP_CHEMIN_BIBLIOTHEQUE.'adap_application.fonct.php'; |
require_once ADAP_CHEMIN_BIBLIOTHEQUE.'HTML_formulaireAppli.class.php' ; |
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus |
if (file_exists(ADAP_CHEMIN_LANGUE.'adap_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) { |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/ |
require_once ADAP_CHEMIN_LANGUE.'adap_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php'; |
} else { |
/** Inclusion du fichier de traduction par défaut.*/ |
require_once ADAP_CHEMIN_LANGUE.'adap_langue_'.ADAP_I18N_DEFAUT.'.inc.php'; |
} |
// Stockage des styles de l'application |
GEN_stockerStyleExterne('adap_standard', ADAP_CHEMIN_STYLE.'adap_standard.css'); |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
function afficherContenuCorps() |
{ |
$db = &$GLOBALS['_GEN_commun']['pear_db'] ; |
$url = $GLOBALS['_GEN_commun']['url'] ; |
$auth = &$GLOBALS['_GEN_commun']['pear_auth'] ; |
$res=''; |
if (!$auth->getAuth()) { |
$res .= '<p class="zone_alert">'.ADAP_IDENTIFIEZ_VOUS.'</p>'."\n" ; |
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ; |
$res .= $url->getURL(); |
$res .= '" method="post"> |
<fieldset> |
<legend>Identifiez vous</legend> |
<label for="username">Courriel : </label> |
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" /> |
<label for="password">Mot de passe : </label> |
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" /> |
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" /> |
</fieldset> |
</form>'; |
return $res ; |
} else { |
// Le lien pour une nouvelle entrée |
$url->addQueryString('action', 'nouveau'); |
$url_nouveau = $url->getURL(); |
$url->removeQueryString('action', 'nouveau'); |
$res .= '<a href="'.$url_nouveau.'">'.ADAP_AJOUTER.'</a>'."\n<br />" ; |
// traitement de la suppression |
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'supprimer') adap_supprimer_application($_REQUEST['id_appl'], $db) ; |
// traitement de l'ajout |
if (isset ($_REQUEST['action']) || isset ($_REQUEST['id_appl'])) { |
$formulaire = new HTML_formulaireAppl('formulaire_appl', '', str_replace ('&', '&', $url->getURL())) ; |
$formulaire->construitFormulaire($url) ; |
// On ajoute un champs caché avec action=nouveau_v |
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'nouveau') { |
$formulaire->addElement ('hidden', 'action', 'nouveau_v') ; |
return $formulaire->toHTML() ; |
} |
if (isset ($_REQUEST['id_appl']) && !isset ($_REQUEST['action'])) { |
$formulaire->addElement ('hidden', 'action', 'modifier_v') ; |
$formulaire->addElement ('hidden', 'id_appl', $_REQUEST['id_appl']) ; |
$formulaire->setDefaults(adap_valeurs_par_defaut($_REQUEST['id_appl'], $db)) ; |
return $formulaire->toHTML() ; |
} |
if ($_REQUEST['action'] == 'modifier_v') { |
if ($formulaire->validate()) { |
mise_a_jour ($formulaire->getSubmitValues(), $db) ; |
} |
} |
if ($_REQUEST['action'] == 'nouveau_v') { |
if ($formulaire->validate()) { |
insertion ($formulaire->getSubmitValues(), $db) ; |
} |
} |
} |
// Comportement par défaut |
// requete sur la table gen_application |
$requete = 'SELECT gap_id_application, gap_nom FROM gen_application where gap_id_application <> 0 ORDER BY gap_nom ASC' ; |
$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_appl') ; |
return ; |
} |
$liste = new HTML_TableFragmenteur () ; |
$liste->construireEntete(array (ADAP_NOM_APPL, ADAP_SUPPRIMER)) ; |
$tableau_appl = array() ; |
while ($ligne = $resultat->fetchRow()) { |
$url->addQueryString ('id_appl', $ligne[0]) ; |
array_push ($tableau_appl, array ('<a href="'.$url->getURL().'">'.$ligne[1].'</a>'."\n", // Première colonne, le nom de l'application |
'<a href="'.$url->getURL().'&action=supprimer" onclick="javascript:return confirm (\''.ADAP_SUPPRIMER.' ?\');">'.ADAP_SUPPRIMER.'</a>'."\n" |
)); |
} |
$liste->construireListe($tableau_appl) ; |
$res .= $liste->toHTML(); |
return $res ; |
} |
}// Fin de la fonction afficherContenuCorps() |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.8 2007-03-20 14:17:36 alexandre_tb |
* remplacement des varaibles $GLOBALS par $_REQUEST, pour que l appli fonctionne avec les register_globals à Off |
* |
* Revision 1.7 2006/12/01 10:39:14 alexandre_tb |
* Suppression des références aux applettes |
* |
* Revision 1.6 2006/10/06 10:40:51 florian |
* harmonisation des messages d'erreur de l'authentification |
* |
* Revision 1.5 2006/09/07 13:28:39 jp_milcent |
* Mise en majuscule des termes SQL et trie des application par ordre alphabétique. |
* |
* Revision 1.4 2005/03/09 10:46:17 jpm |
* Changement d'un nom de fichier. |
* |
* Revision 1.3 2005/03/09 10:40:26 alex |
* version initiale |
* |
* Revision 1.2 2005/02/28 10:32:59 jpm |
* Changement de nom de dossier. |
* |
* Revision 1.1 2004/12/13 18:07:19 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/branches/v3.0-aha/papyrus/applications/admin_application/configuration/adap_configuration.inc.php |
---|
New file |
0,0 → 1,80 |
<?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: adap_configuration.inc.php,v 1.1 2004-12-13 18:07:33 alex Exp $ |
/** |
* Fichier de configuration général de l'application Administration des applications. |
* |
* Permet de définir certains paramètres valables pour toutes l'application |
* Administrateur des applications. |
* |
*@package Admin_application |
*@subpackage Configuration |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Constante stockant la valeur de la langue par défaut pour l'appli ADAP.*/ |
define('ADAP_I18N_DEFAUT', GEN_I18N_ID_DEFAUT); |
// Chemin des fichiers à inclure. |
/** Chemin vers la bibliothèque PEAR.*/ |
define('ADAP_CHEMIN_BIBLIOTHEQUE_PEAR', ''); |
/** Chemin vers la bibliothèque API.*/ |
define('ADAP_CHEMIN_BIBLIOTHEQUE_API', GEN_CHEMIN_API); |
/** Chemin vers la bibliothèque de Papyrus.*/ |
define('ADAP_CHEMIN_BIBLIOTHEQUE_GEN', GEN_CHEMIN_BIBLIO); |
// Chemin vers les dossiers de l'application |
/** Chemin vers l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_APPLICATION', GEN_CHEMIN_APPLICATION.'admin_application/'); |
/** Chemin vers les images de l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_IMAGE_INTERFACE', ADAP_CHEMIN_APPLICATION.'presentations/images/interface/'); |
/** Chemin vers la bibliothèque de l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_BIBLIOTHEQUE', ADAP_CHEMIN_APPLICATION.'bibliotheque/'); |
/** Chemin vers les classes de l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_CLASSES', ADAP_CHEMIN_APPLICATION.'classes/'); |
/** Chemin vers les fichiers de traduction de l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_LANGUE', ADAP_CHEMIN_APPLICATION.'langues/'); |
/** Chemin vers les styles de l'application Admin Auth de Papyrus.*/ |
define('ADAP_CHEMIN_STYLE', ADAP_CHEMIN_APPLICATION.'presentations/styles/'); |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/branches/v3.0-aha/papyrus/applications/admin_application/bibliotheque/adap_application.fonct.php |
---|
New file |
0,0 → 1,153 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Papyrus. | |
// | | |
// | Foobar 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 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar 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 Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: adap_application.fonct.php,v 1.4 2006-12-01 10:39:14 alexandre_tb Exp $ |
/** |
* Contient les fonctions de l'appli admin_auth |
* |
* |
* |
* |
*@package Admin_auth |
*@subpackage Fonctions |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* |
* |
* @return |
*/ |
function adap_supprimer_application($id_appl, &$db) { |
$requete = 'DELETE FROM gen_application WHERE gap_id_application='.$id_appl; |
$resultat = $db->query ($requete) ; |
} |
/** |
* |
* |
* @return |
*/ |
function adap_valeurs_par_defaut ($id_appl, &$db) { |
// requete sur gen_site_auth |
$requete = 'SELECT * FROM gen_application WHERE gap_id_application='.$id_appl ; |
$resultat = $db->query ($requete) ; |
if (DB::isError ($resultat)) { |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ; |
return ; |
} |
$tableau_retour = array () ; |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ; |
$tableau_retour['nom_appl'] = $ligne->gap_nom ; |
$tableau_retour['description'] = $ligne->gap_description ; |
$tableau_retour['chemin'] = $ligne->gap_chemin ; |
unset ($requete, $resultat) ; |
return $tableau_retour ; |
} |
/** |
* |
* |
* @return |
*/ |
function insertion ($valeur, &$db) { |
$id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ; |
$requete = "insert into gen_application set gap_id_application=" |
.$id_appl_bdd."," |
.requete_site_appl($valeur) ; |
$resultat = $db->query ($requete) ; |
if (DB::isError ($resultat)) { |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ; |
} |
} |
/** |
* |
* |
* @return |
*/ |
function mise_a_jour ($valeur, &$db) { |
$requete = "update gen_application set ".requete_site_appl($valeur) |
.' WHERE gap_id_application='.$GLOBALS['id_appl'] ; |
$resultat = $db->query ($requete) ; |
if (DB::isError ($resultat)) { |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ; |
} |
} |
/** |
* |
* |
* @return string un morceau de code SQL |
*/ |
function requete_site_appl (&$valeur) { |
if (!isset($valeur['applette'])) {$valeur['applette']=0;} |
return 'gap_nom="'.$valeur['nom_appl'].'", ' |
.'gap_description="'.$valeur['description'].'", ' |
.'gap_chemin="'.$valeur['chemin'].'"'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2006/09/07 13:28:39 jp_milcent |
* Mise en majuscule des termes SQL et trie des application par ordre alphabétique. |
* |
* Revision 1.2 2005/09/23 15:02:38 florian |
* correction de bugs |
* |
* Revision 1.1 2005/03/09 10:44:04 jpm |
* Mise au norme du nom du fichier. |
* |
* Revision 1.2 2005/03/09 10:40:33 alex |
* version initiale |
* |
* Revision 1.1 2004/12/13 18:07:28 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/branches/v3.0-aha/papyrus/applications/admin_application/bibliotheque/HTML_formulaireAppli.class.php |
---|
New file |
0,0 → 1,123 |
<?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: HTML_formulaireAppli.class.php,v 1.5 2007-06-26 14:18:53 florian Exp $ |
/** |
* Application projet |
* |
* La classe HTML_formulaireAuth |
* |
*@package projet |
//Auteur original : |
*@author Alexandre Granier <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */ |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ; |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ; |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE des constantes | |
// +------------------------------------------------------------------------------------------------------+ |
/** |
* class HTML_formulaireProjet |
* Cette classe représente un formulaire pour saisir un projet ou le modifier. |
*/ |
class HTML_formulaireAppl extends HTML_QuickForm |
{ |
/** |
* Constructeur |
* |
* @param string formName Le nom du formulaire. |
* @param string method Soit get soit post, voir le protocole HTTP |
* @param string action L'action du formulaire. |
* @param string target La cible du formulaire. |
* @param Array attributes Des attributs supplémentaires pour la balise <form> |
* @param bool trackSubmit Pour repérer si la formulaire a été soumis. |
* @return void |
* @access public |
*/ |
function HTML_formulaireAppl( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false ) |
{ |
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ; |
} // end of member function HTML_formulaireProjet |
/** |
* Renvoie le code HTML du formulaire. |
* |
* @return string |
* @access public |
*/ |
function toHTML( ) |
{ |
$res = HTML_QuickForm::toHTML() ; |
return $res ; |
} // end of member function toHTML |
/** |
* Ajoute les champs nécessaire au formulaire. |
* |
* @return void |
* @access public |
*/ |
function construitFormulaire($url_retour) |
{ |
$squelette =& $this->defaultRenderer(); |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n"); |
$squelette->setElementTemplate( '<p class="formulaire_element"><span class="form_label">'."\n". |
'{label}'."\n". |
'<!-- BEGIN required --><span style="color:red; width:5px; margin:0; padding:0;">*</span><!-- END required -->'."\n". |
'</span>'."\n".'{element}'."\n". |
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n". |
'</p>'."\n"); |
$squelette->setGroupElementTemplate('<p style="display:inline">{element}</p>', 'form_boutons'); |
$squelette->setRequiredNoteTemplate("\n".'<p class="symbole_obligatoire">* : {requiredNote}</p>'."\n"); |
//Note pour les erreurs javascript |
$this->setJsWarnings('Erreur de saisie', 'Veuillez verifier vos informations saisies'); |
// Note de fin de formulaire |
$this->setRequiredNote('Indique les champs obligatoires'); |
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 35)) ; |
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ; |
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ; |
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 35)) ; |
$this->addElement('html', '<br />'); |
$this->setRequiredNote(ADAP_CHAMPS_REQUIS) ; |
// on fait un groupe avec les boutons pour les mettres sur la même ligne |
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAP_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&', '&', $url_retour->getURL())."'")); |
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAP_VALIDER); |
$this->addGroup($buttons, 'form_boutons', null, ' '); |
} // end of member function _construitFormulaire |
} // end of HTML_formulaireProjet |
?> |