/trunk/papyrus/bibliotheque/fonctions/pap_menu.fonct.php |
---|
19,7 → 19,7 |
// | 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: pap_menu.fonct.php,v 1.23 2005-08-29 09:05:12 ddelon Exp $ |
// CVS : $Id: pap_menu.fonct.php,v 1.24 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Bibliothèque de fonction sur le rendu. |
* |
33,7 → 33,7 |
*@author Alexandre GRANIER <alexadandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.23 $ $Date: 2005-08-29 09:05:12 $ |
*@version $Revision: 1.24 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
187,12 → 187,14 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT); |
$resultat->free(); |
if ($ligne->gmr_id_menu_02 == 0) { |
return false; |
} else if ($ligne->gmr_id_menu_02 == $id_menu_1) { |
return true; |
} else { |
return GEN_etreAncetre($id_menu_1, $ligne->gmr_id_menu_02); |
if (isset($ligne)) { |
if ($ligne->gmr_id_menu_02 == 0) { |
return false; |
} else if ($ligne->gmr_id_menu_02 == $id_menu_1) { |
return true; |
} else { |
return GEN_etreAncetre($id_menu_1, $ligne->gmr_id_menu_02); |
} |
} |
} |
689,6 → 691,9 |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.23 2005/08/29 09:05:12 ddelon |
* Suppression message debug |
* |
* Revision 1.22 2005/07/08 15:16:37 alexandre_tb |
* ajout de la fonction GEN_lireInfoMenuMeta() qui permet de sélectionner des menus en fonction de leur mot clé et leur catégorie |
* |
/trunk/papyrus/pap_verification.inc.php |
---|
19,7 → 19,7 |
// | 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: pap_verification.inc.php,v 1.5 2005-02-28 11:20:42 jpm Exp $ |
// CVS : $Id: pap_verification.inc.php,v 1.6 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Réalisation de la vérification des besoins de Papyrus. |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Laurent COUDOUNEAU <lc@gsite.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2005-02-28 11:20:42 $ |
*@version $Revision: 1.6 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
74,6 → 74,7 |
} |
// Niveau d'erreur pour le code PHP de Papyrus |
// Inutile car shunté par set_error_handler du gestionnaire d'erreur |
error_reporting(GEN_DEBOGAGE_NIVEAU); |
// +------------------------------------------------------------------------------------------------------+ |
83,6 → 84,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2005/02/28 11:20:42 jpm |
* Modification des auteurs. |
* |
* Revision 1.4 2004/10/25 16:28:47 jpm |
* Ajout de nouvelles balises Papyrus, ajout vérification mise à jour de Papyrus, meilleure gestion des sessions... |
* |
/trunk/papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: more_recherche.class.php,v 1.4 2005-05-25 13:49:22 jpm Exp $ |
// CVS : $Id: more_recherche.class.php,v 1.5 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Classe permettant d'effectuer des recherches sur les métas informations des menus. |
* |
34,7 → 34,7 |
//Autres auteurs : |
*@author aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.4 $ $Date: 2005-05-25 13:49:22 $ |
*@version $Revision: 1.5 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
102,7 → 102,7 |
*/ |
function rechercherMotif() { |
foreach ($this->getMoteurs() as $cle => $val) { |
$this->setResultats(array_merge($this->getResultats(), $val->rechercherMotif($this->getMotif()))); |
$this->setResultats(array_merge((array)$this->getResultats(),(array) $val->rechercherMotif($this->getMotif()))); |
} |
$aso_resultats = $this->getResultats(); |
function comparer($a, $b) { |
177,6 → 177,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.4 2005/05/25 13:49:22 jpm |
* Corection erreur pour la recherche dans le contenu. |
* |
* Revision 1.3 2005/05/19 12:46:12 jpm |
* Correction bogue accesskey. |
* Ajout d'un id à la liste. |
/trunk/papyrus/installation/papyrus_v0.23.sql |
---|
New file |
0,0 → 1,3 |
-- Réglages parametres langues |
UPDATE `gen_i18n` SET `gi_ce_pays` = 'FR', `gi_jeu_de_caracteres` = 'iso-8859-1' WHERE `gi_id_i18n` = 'fr'; |
UPDATE `gen_i18n` SET `gi_ce_pays` = 'UK', `gi_jeu_de_caracteres` = 'iso-8859-1' WHERE `gi_id_i18n` = 'en'; |
/trunk/papyrus/pap_initialise_info.inc.php |
---|
21,7 → 21,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// | | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: pap_initialise_info.inc.php,v 1.21 2005-08-31 17:34:52 ddelon Exp $ |
// CVS : $Id: pap_initialise_info.inc.php,v 1.22 2005-09-20 17:01:22 ddelon Exp $ |
/** |
*Initialisation de Papyrus : vérification et récupération de paramètres généraux. |
* |
41,7 → 41,7 |
*@author Alexandre GRANIER <alex@tela-botanica.org> |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.21 $ $Date: 2005-08-31 17:34:52 $ |
*@version $Revision: 1.22 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
240,7 → 240,6 |
} |
// Nous stockons la valeur trouvé pour l'url demandée dans la variable globale de Génésia. |
$_GEN_commun['i18n'] = $i18n; |
// Recherche de la présence de la valeur d'i18n dans l'url |
if ( (! isset($_GET[GEN_URL_CLE_I18N])) || (empty($_GET[GEN_URL_CLE_I18N])) ) { |
$_GEN_commun['url_i18n'] = ''; |
261,6 → 260,7 |
$_GEN_commun['info_i18n'] = $resultat->fetchRow(DB_FETCHMODE_OBJECT); |
$resultat->free(); |
//Gestion de l'erreur aucune internationalisation trouvable. |
if (empty($_GEN_commun['i18n'])) { |
die('ERREUR Génésia : valeur internationalisation introuvable. <br />'. |
272,7 → 272,6 |
$requete = 'SELECT * '. |
'FROM gen_i18n_langue '. |
'WHERE gil_id_langue = "'.$_GEN_commun['info_i18n']->gi_ce_langue.'"'; |
$resultat = $db->query($requete); |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
283,7 → 282,6 |
$requete = 'SELECT * '. |
'FROM gen_i18n_pays '. |
'WHERE gip_id_pays = "'.$_GEN_commun['info_i18n']->gi_ce_pays.'"'; |
$resultat = $db->query($requete); |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
497,6 → 495,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.21 2005/08/31 17:34:52 ddelon |
* Integrateur Wikini et administration des Wikini |
* |
* Revision 1.20 2005/06/24 10:48:35 jpm |
* Modification des chemins des fichiers pour fonctionnement avec API Pear locale. |
* |
/trunk/papyrus/applications/admin_menu/bibliotheque/adme_menu_classique.fonct.php |
---|
32,7 → 32,7 |
// pris connaissance de la licence CeCILL, et que vous en avez accepté les |
// termes. |
// ---- |
// CVS : $Id: adme_menu_classique.fonct.php,v 1.22 2005-07-08 21:13:15 ddelon Exp $ |
// CVS : $Id: adme_menu_classique.fonct.php,v 1.23 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Fonctions de gestion des menus classiques |
* |
48,7 → 48,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <lc@gsite.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.22 $ $Date: 2005-07-08 21:13:15 $ |
*@version $Revision: 1.23 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
422,8 → 422,10 |
// Requete pour récupérer les informations issues des relations du site à modifier |
$ligne = GEN_lireInfoMenuRelation($db, $adme_menu_id, $id_valeur = 101); |
$aso_valeurs['defaut'] = false; |
if ($ligne->gmr_id_valeur != false) {// 101 = site par défaut |
$aso_valeurs['defaut'] = true; |
if (isset($ligne) && !empty($ligne)) { |
if ($ligne->gmr_id_valeur != false) {// 101 = site par défaut |
$aso_valeurs['defaut'] = true; |
} |
} |
} |
1063,10 → 1065,15 |
(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : ''; |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT); |
$no = $ligne->gmr_ordre + 1; |
$resultat->free(); |
if (isset($ligne)) { |
$no = $ligne->gmr_ordre + 1; |
} |
else { |
$no = 1; |
} |
// Mise à jour pere menu courant |
$requete = 'UPDATE gen_menu_relation SET '. |
'gmr_id_menu_02 = '.$ligne_menu->gmr_id_menu_01.' ,'. |
1076,8 → 1083,6 |
$resultat_update = $db->query($requete); |
(DB::isError($resultat_update)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_update->getMessage(), $requete)) : ''; |
} |
} |
1163,6 → 1168,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.22 2005/07/08 21:13:15 ddelon |
* Gestion indentation menu |
* |
* Revision 1.21 2005/05/26 16:13:08 jpm |
* Correction taille éditeur: passage en text |
* |
/trunk/papyrus/applications/admin_site/bibliotheque/adsi_site.fonct.php |
---|
19,7 → 19,7 |
// | 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: adsi_site.fonct.php,v 1.22 2005-05-27 16:06:16 jpm Exp $ |
// CVS : $Id: adsi_site.fonct.php,v 1.23 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Bibliothèque de fonctions d'admininistration des projets |
* |
34,7 → 34,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <lc@gsite.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.22 $ $Date: 2005-05-27 16:06:16 $ |
*@version $Revision: 1.23 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
440,11 → 440,13 |
die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_admin->getMessage(), $requete_admin)); |
} |
$ligne_admin = $resultat_admin->fetchRow(DB_FETCHMODE_OBJECT); |
$info_admin = '<p class="info">Site créé le '.$aso_valeurs['gs_date_creation'].'. Dernière modification par'. |
if (isset($ligne_admin)) { |
$info_admin = '<p class="info">Site créé le '.$aso_valeurs['gs_date_creation'].'. Dernière modification par'. |
$ligne_admin->ga_prenom.' '.$ligne_admin->ga_nom.'.'.'</p>'; |
$form->addElement('html', $info_admin); |
$form->addElement('hidden', 'gs_ce_admin'); |
$form->addElement('hidden', 'gs_date_creation'); |
$form->addElement('html', $info_admin); |
$form->addElement('hidden', 'gs_ce_admin'); |
$form->addElement('hidden', 'gs_date_creation'); |
} |
// Titre de la page: |
$titre = 'Modifier un site'; |
1164,6 → 1166,9 |
// +- Fin du code source --------------------------------------------------------------------------------+ |
/* |
* $Log: not supported by cvs2svn $ |
* Revision 1.22 2005/05/27 16:06:16 jpm |
* Gestion des infos sur l'admin modifiant les infos. |
* |
* Revision 1.21 2005/04/08 13:29:04 jpm |
* Utiliation de références. |
* Correction du double & dans les urls du formulaire. |
/trunk/papyrus/configuration/pap_config_avancee.inc.php |
---|
22,7 → 22,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// | | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: pap_config_avancee.inc.php,v 1.16 2005-08-31 17:34:52 ddelon Exp $ |
// CVS : $Id: pap_config_avancee.inc.php,v 1.17 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Page de configuration avancée de Papyrus |
* |
36,7 → 36,7 |
*@author Alexandre GRANIER <alex@tela-botanica.org> |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.16 $ $Date: 2005-08-31 17:34:52 $ |
*@version $Revision: 1.17 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
72,6 → 72,7 |
* applications.*/ |
define('GEN_DEBOGAGE_I18N', 'fr'); |
// +------------------------------------------------------------------------------------------------------+ |
// Paramétrage du nom du champ servant à identifier un site dans l'url |
/** Type du code d'un site passé dans l'url.*/ |
197,6 → 198,9 |
); |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.16 2005/08/31 17:34:52 ddelon |
* Integrateur Wikini et administration des Wikini |
* |
* Revision 1.15 2005/04/21 16:46:51 jpm |
* Gestion via Papyrus du XHTML de Text_Wiki_Papyrus. |
* |
/trunk/papyrus/pap_initialise_auth.inc.php |
---|
21,7 → 21,7 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// | | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.18 2005-07-07 09:15:36 alexandre_tb Exp $ |
// CVS : $Id: pap_initialise_auth.inc.php,v 1.19 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Initialisation de l'authentification. |
* |
37,7 → 37,7 |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.18 $ $Date: 2005-07-07 09:15:36 $ |
*@version $Revision: 1.19 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
82,6 → 82,7 |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_abreviation'] = $ligne_auth->gsa_abreviation; |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth]['gsa_ce_type_auth'] = $ligne_auth->gsa_ce_type_auth; |
if ($ligne_auth->gsa_id_auth == $GLOBALS['_GEN_commun']['info_site']->gs_ce_auth) { |
$GLOBALS['_GEN_commun']['info_auth'] = $ligne_auth; |
} |
110,7 → 111,8 |
} |
} |
} |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = array_merge($GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth], $tab_auth_bdd); |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = array_merge((array)$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth], (array) $tab_auth_bdd); |
$resultat_auth_bdd->free(); |
} else if ($ligne_auth->gsa_ce_auth_ldap != 0) { |
//Identification via LDAP : |
126,7 → 128,7 |
if ($ligne_auth->gsa_id_auth == $_GEN_commun['info_site']->gs_ce_auth) { |
$GLOBALS['_GEN_commun']['info_auth_ldap'] = $tab_auth_ldap; |
} |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = array_merge($GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth], $tab_auth_ldap); |
$GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth] = array_merge((array) $GLOBALS['_PAPYRUS_']['auth'][$ligne_auth->gsa_id_auth], (array) $tab_auth_ldap); |
$resultat_auth_ldap->free(); |
} else { |
die('ERREUR Papyrus : impossible de trouver les information authentification. <br />'. |
308,6 → 310,10 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log: not supported by cvs2svn $ |
* Revision 1.18 2005/07/07 09:15:36 alexandre_tb |
* mise en place de la co-authentification Wikini - papyrus. |
* - ajout d'une requete pour récupérer le mot de passe |
* |
* Revision 1.17 2005/04/27 15:06:21 alex |
* ajout de l'authentification wiki. |
* |
/trunk/papyrus/pap_rendu.inc.php |
---|
32,7 → 32,7 |
// pris connaissance de la licence CeCILL, et que vous en avez accepté les |
// termes. |
// ---- |
// CVS : $Id: pap_rendu.inc.php,v 1.16 2005-07-12 09:13:15 alexandre_tb Exp $ |
// CVS : $Id: pap_rendu.inc.php,v 1.17 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Rendu : programme traitant l'url demandée et retournant la page compressé au navigateur. |
* |
48,7 → 48,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <laurent.coudouneau@ema.fr> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.16 $ $Date: 2005-07-12 09:13:15 $ |
*@version $Revision: 1.17 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
188,6 → 188,7 |
$GLOBALS['_PAPYRUS_']['page']['periode_validite'] = htmlentities($_GEN_commun['info_menu']->gm_date_debut_validite); |
$GLOBALS['_PAPYRUS_']['page']['date_copyright'] = htmlentities($_GEN_commun['info_menu']->gm_date_copyright); |
$GLOBALS['_PAPYRUS_']['page']['source'] = htmlentities($_GEN_commun['info_menu']->gm_source); |
if ($_GEN_commun['info_i18n_pays']->gip_id_pays != '') { |
$GLOBALS['_PAPYRUS_']['page']['langue_rfc_3066'] = $GLOBALS['_PAPYRUS_']['page']['langue'].'-'.htmlentities($_GEN_commun['info_i18n_pays']->gip_id_pays); |
} else { |
404,6 → 405,10 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.16 2005/07/12 09:13:15 alexandre_tb |
* déplacement de l'appel de la fonction afficherContenuMenu APRES l'appel de afficherContenuCorps. |
* Le menu d'une application étant calculé après les opérations de l'application. |
* |
* Revision 1.15 2005/07/08 21:13:15 ddelon |
* Gestion indentation menu |
* |
/trunk/api/pear/HTML/QuickForm.php |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/pear/HTML/QuickForm/radio.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: radio.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: radio.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/input.php'); |
/trunk/api/pear/HTML/QuickForm/input.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: input.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: input.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/element.php"); |
/trunk/api/pear/HTML/QuickForm/RuleRegistry.php |
---|
18,7 → 18,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: RuleRegistry.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: RuleRegistry.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Registers rule objects and uses them for validation |
215,17 → 215,20 |
$jsIndex = isset($index)? '[' . $index . ']': ''; |
$tmp_reset = $reset? " var field = frm.elements['$elementName'];\n": ''; |
if (is_a($element, 'html_quickform_group')) { |
$value = " var {$elementName}Elements = '::"; |
for ($i = 0, $count = count($element->_elements); $i < $count; $i++) { |
$value .= $element->getElementName($i) . '::'; |
$value = " _qfGroups['{$elementName}'] = {"; |
$elements =& $element->getElements(); |
for ($i = 0, $count = count($elements); $i < $count; $i++) { |
$append = ($elements[$i]->getType() == 'select' && $elements[$i]->getMultiple())? '[]': ''; |
$value .= "'" . $element->getElementName($i) . $append . "': true" . |
($i < $count - 1? ', ': ''); |
} |
$value .= |
"';\n" . |
"};\n" . |
" value{$jsIndex} = new Array();\n" . |
" var valueIdx = 0;\n" . |
" for (var i = 0; i < frm.elements.length; i++) {\n" . |
" var _element = frm.elements[i];\n" . |
" if ({$elementName}Elements.indexOf('::' + _element.name + '::') >= 0) {\n" . |
" if (_element.name in _qfGroups['{$elementName}']) {\n" . |
" switch (_element.type) {\n" . |
" case 'checkbox':\n" . |
" case 'radio':\n" . |
233,11 → 236,23 |
" value{$jsIndex}[valueIdx++] = _element.value;\n" . |
" }\n" . |
" break;\n" . |
" case 'select':\n" . |
" case 'select-one':\n" . |
" if (-1 != _element.selectedIndex) {\n" . |
" value{$jsIndex}[valueIdx++] = _element.options[_element.selectedIndex].value;\n" . |
" }\n" . |
" break;\n" . |
" case 'select-multiple':\n" . |
" var tmpVal = new Array();\n" . |
" var tmpIdx = 0;\n" . |
" for (var j = 0; j < _element.options.length; j++) {\n" . |
" if (_element.options[j].selected) {\n" . |
" tmpVal[tmpIdx++] = _element.options[j].value;\n" . |
" }\n" . |
" }\n" . |
" if (tmpIdx > 0) {\n" . |
" value{$jsIndex}[valueIdx++] = tmpVal;\n" . |
" }\n" . |
" break;\n" . |
" default:\n" . |
" value{$jsIndex}[valueIdx++] = _element.value;\n" . |
" }\n" . |
247,13 → 262,14 |
$tmp_reset = |
" for (var i = 0; i < frm.elements.length; i++) {\n" . |
" var _element = frm.elements[i];\n" . |
" if ({$elementName}Elements.indexOf('::' + _element.name + '::') >= 0) {\n" . |
" if (_element.name in _qfGroups['{$elementName}']) {\n" . |
" switch (_element.type) {\n" . |
" case 'checkbox':\n" . |
" case 'radio':\n" . |
" _element.checked = _element.defaultChecked;\n" . |
" break;\n" . |
" case 'select':\n" . |
" case 'select-one':\n" . |
" case 'select-multiple:\n" . |
" for (var j = 0; j < _element.options.length; j++) {\n" . |
" _element.options[j].selected = _element.options[j].defaultSelected;\n" . |
" }\n" . |
277,7 → 293,7 |
" }\n" . |
" }\n"; |
} else { |
$value = " value{$jsIndex} = frm.elements['{$elementName}'].options[frm.elements['{$elementName}'].selectedIndex].value;\n"; |
$value = " value{$jsIndex} = frm.elements['{$elementName}'].selectedIndex == -1? '': frm.elements['{$elementName}'].options[frm.elements['{$elementName}'].selectedIndex].value;\n"; |
} |
if ($reset) { |
$tmp_reset .= |
286,7 → 302,7 |
" }\n"; |
} |
} elseif ($element->getType() == 'checkbox') { |
} elseif ($element->getType() == 'checkbox' && !is_a($element, 'html_quickform_advcheckbox')) { |
$value = " if (frm.elements['$elementName'].checked) {\n" . |
" value{$jsIndex} = '1';\n" . |
" } else {\n" . |
/trunk/api/pear/HTML/QuickForm/autocomplete.php |
---|
23,7 → 23,7 |
// | http://www.sitepoint.com/article/1220 | |
// +----------------------------------------------------------------------+ |
// |
// $Id: autocomplete.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: autocomplete.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/text.php"); |
53,6 → 53,14 |
*/ |
var $_options = array(); |
/** |
* "One-time" javascript (containing functions), see bug #4611 |
* |
* @var string |
* @access private |
*/ |
var $_js = ''; |
// }}} |
// {{{ constructor |
114,7 → 122,7 |
} else { |
$js = "<script type=\"text/javascript\">\n//<![CDATA[\n"; |
if (!defined('HTML_QUICKFORM_AUTOCOMPLETE_EXISTS')) { |
$js .= <<<EOS |
$this->_js .= <<<EOS |
/* begin javascript for autocomplete */ |
function setSelectionRange(input, selectionStart, selectionEnd) { |
225,7 → 233,8 |
'"' => '\"', |
'\\' => '\\\\' |
); |
$js .= $this->_js; |
$js .= 'var ' . $arrayName . " = new Array();\n"; |
for ($i = 0; $i < count($this->_options); $i++) { |
$js .= $arrayName . '[' . $i . "] = '" . strtr($this->_options[$i], $jsEscape) . "';\n"; |
/trunk/api/pear/HTML/QuickForm/password.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: password.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: password.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/submit.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: submit.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: submit.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/xbutton.php |
---|
16,7 → 16,7 |
// | Authors: Alexey Borzov <avb@php.net> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: xbutton.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: xbutton.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/element.php'; |
/trunk/api/pear/HTML/QuickForm/html.php |
---|
16,7 → 16,7 |
// | Author: Alexey Borzov <borz_off@cs.msu.su> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: html.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: html.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/static.php'; |
/trunk/api/pear/HTML/QuickForm/Renderer.php |
---|
16,7 → 16,7 |
// | Author: Alexey Borzov <borz_off@cs.msu.su> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Renderer.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Renderer.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* An abstract base class for QuickForm renderers |
/trunk/api/pear/HTML/QuickForm/Rule.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Rule.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Rule.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
class HTML_QuickForm_Rule |
{ |
/trunk/api/pear/HTML/QuickForm/button.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: button.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: button.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/date.php |
---|
18,7 → 18,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: date.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: date.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/group.php'; |
require_once 'HTML/QuickForm/select.php'; |
111,13 → 111,7 |
'fr' => array ( |
'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'), |
'weekdays_long' => array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'), |
'months_short' => array ('Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec'), |
'months_long' => array ('Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Decembre') |
), |
'fr' => array ( |
'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'), |
'weekdays_long' => array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'), |
'months_short' => array ('Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Jun', 'Jul', 'Aou', 'Sep', 'Oct', 'Nov', 'Dec'), |
'months_short' => array ('Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sep', 'Oct', 'Nov', 'Déc'), |
'months_long' => array ('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre') |
), |
'hu' => array ( |
148,7 → 142,7 |
'weekdays_short'=> array ('Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'), |
'weekdays_long' => array ('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'), |
'months_short' => array ('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'), |
'months_long' => array ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septimbre', 'Octubre', 'Noviembre', 'Diciembre') |
'months_long' => array ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre') |
), |
'da' => array ( |
'weekdays_short'=> array ('Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'), |
221,7 → 215,31 |
'weekdays_long' => array('Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П\'ятниця', 'Субота'), |
'months_short' => array('Січ', 'Лют', 'Бер', 'Кві', 'Тра', 'Чер', 'Лип', 'Сер', 'Вер', 'Жов', 'Лис', 'Гру'), |
'months_long' => array('Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень') |
) |
), |
'ro' => array ( |
'weekdays_short'=> array ('Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'), |
'weekdays_long' => array ('Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'), |
'months_short' => array ('Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), |
'months_long' => array ('Ianuarie', 'Februarie', 'Martie', 'Aprilie', 'Mai', 'Iunie', 'Iulie', 'August', 'Septembrie', 'Octombrie', 'Noiembrie', 'Decembrie') |
), |
'he' => array ( |
'weekdays_short'=> array ('ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'), |
'weekdays_long' => array ('יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'שבת'), |
'months_short' => array ('ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'), |
'months_long' => array ('ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר') |
), |
'sv' => array ( |
'weekdays_short'=> array ('Sön', 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör'), |
'weekdays_long' => array ('Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag'), |
'months_short' => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'), |
'months_long' => array ('Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December') |
), |
'pt' => array ( |
'weekdays_short'=> array ('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'), |
'weekdays_long' => array ('Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'), |
'months_short' => array ('Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'), |
'months_long' => array ('Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro') |
) |
); |
// }}} |
316,6 → 334,10 |
case 'h': |
$options = $this->_createOptionList(1, 12); |
break; |
case 'g': |
$options = $this->_createOptionList(1, 12); |
array_walk($options, create_function('&$v,$k', '$v = intval($v);')); |
break; |
case 'H': |
$options = $this->_createOptionList(0, 23); |
break; |
331,6 → 353,9 |
case 'A': |
$options = array('AM' => 'AM', 'PM' => 'PM'); |
break; |
case 'W': |
$options = $this->_createOptionList(1, 53); |
break; |
case '\\': |
$backslash = true; |
$loadSelect = false; |
348,9 → 373,15 |
} |
$separator = ''; |
// Should we add an empty option to the top of the select? |
if ($this->_options['addEmptyOption']) { |
// Preserve the keys |
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options; |
if (!is_array($this->_options['addEmptyOption']) && $this->_options['addEmptyOption'] || |
is_array($this->_options['addEmptyOption']) && !empty($this->_options['addEmptyOption'][$sign])) { |
// Using '+' array operator to preserve the keys |
if (is_array($this->_options['emptyOptionText']) && !empty($this->_options['emptyOptionText'][$sign])) { |
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText'][$sign]) + $options; |
} else { |
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options; |
} |
} |
$this->_elements[] =& new HTML_QuickForm_select($sign, null, $options, $this->getAttributes()); |
} |
391,7 → 422,7 |
$value = strtotime($value); |
} |
// might be a unix epoch, then we fill all possible values |
$arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A', (int)$value)); |
$arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A-W', (int)$value)); |
$value = array( |
'D' => $arr[0], |
'l' => $arr[0], |
402,11 → 433,13 |
'Y' => $arr[3], |
'y' => $arr[3], |
'h' => $arr[4], |
'g' => $arr[4], |
'H' => $arr[5], |
'i' => $arr[6], |
's' => $arr[7], |
'a' => $arr[8], |
'A' => $arr[9] |
'A' => $arr[9], |
'W' => $arr[10] |
); |
} |
parent::setValue($value); |
419,9 → 452,9 |
{ |
include_once('HTML/QuickForm/Renderer/Default.php'); |
$renderer =& new HTML_QuickForm_Renderer_Default(); |
$renderer->setElementTemplate($this->_wrap[0] . '{element}' . $this->_wrap[1]); |
$renderer->setElementTemplate('{element}'); |
parent::accept($renderer); |
return $renderer->toHtml(); |
return $this->_wrap[0] . $renderer->toHtml() . $this->_wrap[1]; |
} |
// }}} |
/trunk/api/pear/HTML/QuickForm/textarea.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: textarea.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: textarea.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/element.php"); |
/trunk/api/pear/HTML/QuickForm/file.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: file.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: file.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/select.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: select.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: select.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/element.php'); |
446,7 → 446,7 |
case (is_a($options, 'db_result')): |
return $this->loadDbResult($options, $param1, $param2, $param3); |
break; |
case (is_string($options) && !empty($options) || is_subclass_of($options, "db_common")): |
case (is_string($options) && !empty($options) ): |
return $this->loadQuery($options, $param1, $param2, $param3, $param4); |
break; |
} |
512,7 → 512,7 |
if (is_array($this->_values)) { |
foreach ($this->_values as $key => $val) { |
for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) { |
if ($val == $this->_options[$i]['attr']['value']) { |
if ((string)$val == (string)$this->_options[$i]['attr']['value']) { |
$value[$key] = $this->_options[$i]['text']; |
break; |
} |
525,13 → 525,16 |
// Only use id attribute if doing single hidden input |
if (1 == count($value)) { |
$id = $this->getAttribute('id'); |
$idAttr = isset($id)? ' id="' . $id . '"': ''; |
$idAttr = isset($id)? array('id' => $id): array(); |
} else { |
$idAttr = ''; |
$idAttr = array(); |
} |
foreach ($value as $key => $item) { |
$html .= '<input type="hidden"' . $idAttr . ' name="' . |
$name . '" value="' . $this->_values[$key] . '" />'; |
$html .= '<input' . $this->_getAttrString(array( |
'type' => 'hidden', |
'name' => $name, |
'value' => $this->_values[$key] |
) + $idAttr) . ' />'; |
} |
} |
return $html; |
573,5 → 576,29 |
} |
// }}} |
// {{{ onQuickFormEvent() |
function onQuickFormEvent($event, $arg, &$caller) |
{ |
if ('updateValue' == $event) { |
$value = $this->_findValue($caller->_constantValues); |
if (null === $value) { |
$value = $this->_findValue($caller->_submitValues); |
// Fix for bug #4465 |
// XXX: should we push this to element::onQuickFormEvent()? |
if (null === $value && !$caller->isSubmitted()) { |
$value = $this->_findValue($caller->_defaultValues); |
} |
} |
if (null !== $value) { |
$this->setValue($value); |
} |
return true; |
} else { |
return parent::onQuickFormEvent($event, $arg, $caller); |
} |
} |
// }}} |
} //end class HTML_QuickForm_select |
?> |
/trunk/api/pear/HTML/QuickForm/Renderer/Array.php |
---|
19,7 → 19,7 |
// | Thomas Schulz <ths@4bconsult.de> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Array.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Array.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/Renderer.php'; |
/trunk/api/pear/HTML/QuickForm/Renderer/ArraySmarty.php |
---|
18,7 → 18,7 |
// | Thomas Schulz <ths@4bconsult.de> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: ArraySmarty.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: ArraySmarty.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/Renderer/Array.php'; |
171,10 → 171,10 |
// we don't need the elements, see the array structure |
unset($ret['elements']); |
} |
if (!empty($this->_required)){ |
if (($required || $error) && !empty($this->_required)){ |
$this->_renderRequired($ret['label'], $ret['html'], $required, $error); |
} |
if (!empty($this->_error)) { |
if ($error && !empty($this->_error)) { |
$this->_renderError($ret['label'], $ret['html'], $error); |
$ret['error'] = $error; |
} |
/trunk/api/pear/HTML/QuickForm/Renderer/ObjectFlexy.php |
---|
16,12 → 16,13 |
// | Author: Ron McClain <ron@humaniq.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: ObjectFlexy.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: ObjectFlexy.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/Renderer/Object.php"); |
/** |
* @abstract Long Description |
* QuickForm renderer for Flexy template engine, static version. |
* |
* A static renderer for HTML_Quickform. Makes a QuickFormFlexyObject |
* from the form content suitable for use with a Flexy template |
* |
36,13 → 37,13 |
* $view->form = $renderer->toObject(); |
* $template->compile("mytemplate.html"); |
* |
* @see QuickFormFlexyObject |
* |
* Based on the code for HTML_QuickForm_Renderer_ArraySmarty |
* |
* @public |
* @see QuickFormFlexyObject |
* @access public |
*/ |
class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object { |
class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object |
{ |
/** |
* HTML_Template_Flexy instance |
* @var object $_flexy |
59,7 → 60,7 |
* The current element index inside a group |
* @var integer $_groupElementIdx |
*/ |
var $_groupElementIdx = 0; |
var $_groupElementIdx = 0; |
/** |
* Name of template file for form html |
115,14 → 116,14 |
* Creates an object representing an element containing |
* the key for storing this |
* |
* @private |
* @access private |
* @param element object An HTML_QuickForm_element object |
* @param required bool Whether an element is required |
* @param error string Error associated with the element |
* @return object |
*/ |
function _elementToObject(&$element, $required, $error) |
{ |
function _elementToObject(&$element, $required, $error) |
{ |
$ret = parent::_elementToObject($element, $required, $error); |
if($ret->type == 'group') { |
$ret->html = $element->toHtml(); |
174,7 → 175,7 |
* Stores an object representation of an element in the |
* QuickformFormObject instance |
* |
* @private |
* @access private |
* @param elObj object Object representation of an element |
* @return void |
*/ |
202,7 → 203,7 |
* {end:} |
* {html:h} |
* |
* @public |
* @access public |
* @param template string Filename of template |
* @return void |
*/ |
222,7 → 223,7 |
* {end:} |
* {label:h} |
* |
* @public |
* @access public |
* @param template string Filename of template |
* @return void |
*/ |
242,172 → 243,19 |
$this->_flexy->compile($this->_html); |
$ret->html = $this->_flexy->bufferedOutputObject($ret); |
} |
} // end class HTML_QuickForm_Renderer_ObjectFlexy |
/** |
* @abstract Long Description |
* This class represents the object passed to outputObject() |
* |
* Eg. |
* {form.outputJavaScript():h} |
* {form.outputHeader():h} |
* <table> |
* <tr> |
* <td>{form.name.label:h}</td><td>{form.name.html:h}</td> |
* </tr> |
* </table> |
* </form> |
* |
* @public |
* Adds nothing to QuickformForm, left for backwards compatibility |
*/ |
class QuickformFlexyForm { |
/** |
* Whether the form has been frozen |
* @var boolean $frozen |
*/ |
var $frozen; |
/** |
* Javascript for client-side validation |
* @var string $javascript |
*/ |
var $javascript; |
class QuickformFlexyForm extends QuickformForm |
{ |
} |
/** |
* Attributes for form tag |
* @var string $attributes |
*/ |
var $attributes; |
/** |
* Note about required elements |
* @var string $requirednote |
*/ |
var $requirednote; |
/** |
* Collected html of all hidden variables |
* @var string $hidden |
*/ |
var $hidden; |
/** |
* Set if there were validation errors. |
* StdClass object with element names for keys and their |
* error messages as values |
* @var object $errors |
*/ |
var $errors; |
/** |
* Array of QuickformElementObject elements. If there are headers in the form |
* this will be empty and the elements will be in the |
* separate sections |
* @var array $elements |
*/ |
var $elements; |
/** |
* Array of sections contained in the document |
* @var array $sections |
*/ |
var $sections; |
/** |
* Output <form> header |
* {form.outputHeader():h} |
* @return string <form attributes> |
*/ |
function outputHeader() |
{ |
$hdr = "<form " . $this->attributes . ">\n"; |
return $hdr; |
} |
/** |
* Output form javascript |
* {form.outputJavaScript():h} |
* @return string Javascript |
*/ |
function outputJavaScript() |
{ |
return $this->javascript; |
} |
} // end class QuickformFlexyForm |
/** |
* Convenience class describing a form element. |
* The properties defined here will be available from |
* your flexy templates by referencing |
* {form.zip.label:h}, {form.zip.html:h}, etc. |
* Adds nothing to QuickformElement, left for backwards compatibility |
*/ |
class QuickformFlexyElement { |
/** |
* Element name |
* @var string $name |
*/ |
var $name; |
/** |
* Element value |
* @var mixed $value |
*/ |
var $value; |
/** |
* Type of element |
* @var string $type |
*/ |
var $type; |
/** |
* Whether the element is frozen |
* @var boolean $frozen |
*/ |
var $frozen; |
/** |
* Label for the element |
* @var string $label |
*/ |
var $label; |
/** |
* Whether element is required |
* @var boolean $required |
*/ |
var $required; |
/** |
* Error associated with the element |
* @var string $error |
*/ |
var $error; |
/** |
* Some information about element style |
* @var string $style |
*/ |
var $style; |
/** |
* HTML for the element |
* @var string $html |
*/ |
var $html; |
/** |
* If element is a group, the group separator |
* @var mixed $separator |
*/ |
var $separator; |
/** |
* If element is a group, an array of subelements |
* @var array $elements |
*/ |
var $elements; |
} // end class QuickformFlexyElement |
?> |
class QuickformFlexyElement extends QuickformElement |
{ |
} |
?> |
/trunk/api/pear/HTML/QuickForm/Renderer/ITDynamic.php |
---|
16,7 → 16,7 |
// | Author: Alexey Borzov <borz_off@cs.msu.su> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: ITDynamic.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: ITDynamic.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/Renderer.php'; |
/trunk/api/pear/HTML/QuickForm/Renderer/QuickHtml.php |
---|
16,7 → 16,7 |
// | Authors: Jason Rust <jrust@rustyparts.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: QuickHtml.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: QuickHtml.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Renderer/Default.php'); |
/trunk/api/pear/HTML/QuickForm/Renderer/Default.php |
---|
18,7 → 18,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Default.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Default.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Renderer.php'); |
154,7 → 154,9 |
*/ |
function toHtml() |
{ |
return $this->_html; |
// _hiddenHtml is cleared in finishForm(), so this only matters when |
// finishForm() was not called (e.g. group::toHtml(), bug #3511) |
return $this->_hiddenHtml . $this->_html; |
} // end func toHtml |
/** |
191,6 → 193,7 |
} else { |
$this->_html .= $this->_hiddenHtml; |
} |
$this->_hiddenHtml = ''; |
$this->_html = str_replace('{content}', $this->_html, $html); |
// add a validation script |
if ('' != ($script = $form->getValidationScript())) { |
/trunk/api/pear/HTML/QuickForm/Renderer/ITStatic.php |
---|
16,7 → 16,7 |
// | Author: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: ITStatic.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: ITStatic.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Renderer.php'); |
/trunk/api/pear/HTML/QuickForm/Renderer/Object.php |
---|
16,7 → 16,7 |
// | Author: Ron McClain <ron@humaniq.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Object.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Object.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Renderer.php'); |
25,9 → 25,10 |
* |
* Based on HTML_Quickform_Renderer_Array code |
* |
* @public |
* @access public |
*/ |
class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer { |
class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer |
{ |
/** |
* The object being generated |
* @var object $_obj |
75,7 → 76,7 |
* Constructor |
* |
* @param collecthidden bool true: collect all hidden elements |
* @public |
* @access public |
*/ |
function HTML_QuickForm_Renderer_Object($collecthidden = false) |
{ |
86,7 → 87,7 |
/** |
* Return the rendered Object |
* @public |
* @access public |
*/ |
function toObject() |
{ |
94,11 → 95,12 |
} |
/** |
* Set the class of the form elements. Defaults to StdClass. |
* Set the class of the form elements. Defaults to QuickformElement. |
* @param type string Name of element class |
* @public |
* @access public |
*/ |
function setElementType($type) { |
function setElementType($type) |
{ |
$this->_elementType = $type; |
} |
125,6 → 127,7 |
$this->_obj->sections[$this->_sectionCount] = $hobj; |
$this->_currentSection = $this->_sectionCount++; |
} |
function renderElement(&$element, $required, $error) |
{ |
$elObj = $this->_elementToObject($element, $required, $error); |
135,7 → 138,8 |
$this->_storeObject($elObj); |
} // end func renderElement |
function renderHidden(&$element) { |
function renderHidden(&$element) |
{ |
if($this->_collectHidden) { |
$this->_obj->hidden .= $element->toHtml() . "\n"; |
} else { |
148,7 → 152,7 |
$this->_currentGroup = $this->_elementToObject($group, $required, $error); |
if(!empty($error)) { |
$name = $this->_currentGroup->name; |
$this->_view->errors->$name = $error; |
$this->_obj->errors->$name = $error; |
} |
} // end func startGroup |
161,7 → 165,7 |
/** |
* Creates an object representing an element |
* |
* @private |
* @access private |
* @param element object An HTML_QuickForm_element object |
* @param required bool Whether an element is required |
* @param error string Error associated with the element |
205,7 → 209,7 |
/** |
* Stores an object representation of an element in the form array |
* |
* @private |
* @access private |
* @param elObj object Object representation of an element |
* @return void |
*/ |
235,8 → 239,7 |
/** |
* @abstract Long Description |
* This class represents the object passed to outputObject() |
* Convenience class for the form object passed to outputObject() |
* |
* Eg. |
* {form.outputJavaScript():h} |
247,79 → 250,80 |
* </tr> |
* </table> |
* </form> |
* |
* @public |
*/ |
class QuickformForm { |
/** |
* Whether the form has been frozen |
* @var boolean $frozen |
*/ |
var $frozen; |
/** |
* Javascript for client-side validation |
* @var string $javascript |
*/ |
var $javascript; |
class QuickformForm |
{ |
/** |
* Whether the form has been frozen |
* @var boolean $frozen |
*/ |
var $frozen; |
/** |
* Attributes for form tag |
* @var string $attributes |
*/ |
var $attributes; |
/** |
* Javascript for client-side validation |
* @var string $javascript |
*/ |
var $javascript; |
/** |
* Note about required elements |
* @var string $requirednote |
*/ |
var $requirednote; |
/** |
* Attributes for form tag |
* @var string $attributes |
*/ |
var $attributes; |
/** |
* Collected html of all hidden variables |
* @var string $hidden |
*/ |
var $hidden; |
/** |
* Note about required elements |
* @var string $requirednote |
*/ |
var $requirednote; |
/** |
* Set if there were validation errors. |
* StdClass object with element names for keys and their |
* error messages as values |
* @var object $errors |
*/ |
var $errors; |
/** |
* Collected html of all hidden variables |
* @var string $hidden |
*/ |
var $hidden; |
/** |
* Array of QuickformElementObject elements. If there are headers in the form |
* this will be empty and the elements will be in the |
* separate sections |
* @var array $elements |
*/ |
var $elements; |
/** |
* Set if there were validation errors. |
* StdClass object with element names for keys and their |
* error messages as values |
* @var object $errors |
*/ |
var $errors; |
/** |
* Array of sections contained in the document |
* @var array $sections |
*/ |
var $sections; |
/** |
* Array of QuickformElementObject elements. If there are headers in the form |
* this will be empty and the elements will be in the |
* separate sections |
* @var array $elements |
*/ |
var $elements; |
/** |
* Output <form> header |
* {form.outputHeader():h} |
* @return string <form attributes> |
*/ |
function outputHeader() { |
$hdr = "<form " . $this->attributes . ">\n"; |
return $hdr; |
} |
/** |
* Output form javascript |
* {form.outputJavaScript():h} |
* @return string Javascript |
*/ |
function outputJavaScript() { |
/** |
* Array of sections contained in the document |
* @var array $sections |
*/ |
var $sections; |
/** |
* Output <form> header |
* {form.outputHeader():h} |
* @return string <form attributes> |
*/ |
function outputHeader() |
{ |
return "<form " . $this->attributes . ">\n"; |
} |
/** |
* Output form javascript |
* {form.outputJavaScript():h} |
* @return string Javascript |
*/ |
function outputJavaScript() |
{ |
return $this->javascript; |
} |
} |
} // end class QuickformForm |
329,8 → 333,8 |
* your flexy templates by referencing |
* {form.zip.label:h}, {form.zip.html:h}, etc. |
*/ |
class QuickformElement { |
class QuickformElement |
{ |
/** |
* Element name |
* @var string $name |
399,40 → 403,30 |
function isType($type) |
{ |
if($this->type == $type) { |
return true; |
} else { |
return false; |
} |
return ($this->type == $type); |
} |
function notFrozen() |
{ |
if(!$this->frozen) { |
return true; |
} else { |
return false; |
} |
return !$this->frozen; |
} |
function isButton() |
{ |
if($this->type == "submit" || $this->type == "reset") { |
return true; |
} else { |
return false; |
} |
return ($this->type == "submit" || $this->type == "reset"); |
} |
/** |
* XXX: why does it use Flexy when all other stuff here does not depend on it? |
*/ |
function outputStyle() |
{ |
$filename = "styles/".$this->style.".html"; |
ob_start(); |
HTML_Template_Flexy::staticQuickTemplate($filename, $this); |
HTML_Template_Flexy::staticQuickTemplate('styles/' . $this->style . '.html', $this); |
$ret = ob_get_contents(); |
ob_end_clean(); |
return $ret; |
} |
} // end class QuickformElement |
?> |
?> |
/trunk/api/pear/HTML/QuickForm/Rule/Email.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Email.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Email.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Rule.php'); |
/trunk/api/pear/HTML/QuickForm/Rule/Regex.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Regex.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Regex.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Rule.php'); |
/trunk/api/pear/HTML/QuickForm/Rule/Callback.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Callback.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Callback.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Rule.php'); |
/trunk/api/pear/HTML/QuickForm/Rule/Range.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Range.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Range.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Rule.php'); |
/trunk/api/pear/HTML/QuickForm/Rule/Required.php |
---|
16,7 → 16,7 |
// | Authors: Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Required.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Required.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/Rule.php'); |
36,7 → 36,7 |
*/ |
function validate($value, $options = null) |
{ |
if ($value == '') { |
if ((string)$value == '') { |
return false; |
} |
return true; |
/trunk/api/pear/HTML/QuickForm/Rule/Compare.php |
---|
16,7 → 16,7 |
// | Author: Alexey Borzov <avb@php.net> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Compare.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: Compare.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/Rule.php'; |
28,7 → 28,7 |
* |
* @access public |
* @package HTML_QuickForm |
* @version $Revision: 1.1 $ |
* @version $Revision: 1.2 $ |
*/ |
class HTML_QuickForm_Rule_Compare extends HTML_QuickForm_Rule |
{ |
/trunk/api/pear/HTML/QuickForm/advcheckbox.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: advcheckbox.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: advcheckbox.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/checkbox.php'); |
197,8 → 197,12 |
'name' => $this->getPrivateName($oldName), |
'onclick' => $this->getOnclickJs($oldName) . ' ' . $oldJs |
)); |
$html = parent::toHtml() . '<input type="hidden" name="' . $oldName . |
'" value="' . $this->getValue() . '" />'; |
$html = parent::toHtml() . '<input' . |
$this->_getAttrString(array( |
'type' => 'hidden', |
'name' => $oldName, |
'value' => $this->getValue() |
)) . ' />'; |
// revert the name and JS, in case this method will be called once more |
$this->updateAttributes(array( |
'name' => $oldName, |
/trunk/api/pear/HTML/QuickForm/reset.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: reset.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: reset.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/image.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: image.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: image.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/** |
/trunk/api/pear/HTML/QuickForm/text.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: text.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: text.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/checkbox.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: checkbox.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: checkbox.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
229,7 → 229,7 |
if (null === $value) { |
// if no boxes were checked, then there is no value in the array |
// yet we don't want to display default value in this case |
if (isset($caller->_submitValues) && 0 < count($caller->_submitValues)) { |
if ($caller->isSubmitted()) { |
$value = $this->_findValue($caller->_submitValues); |
} else { |
$value = $this->_findValue($caller->_defaultValues); |
/trunk/api/pear/HTML/QuickForm/static.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: static.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: static.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/element.php"); |
/trunk/api/pear/HTML/QuickForm/hierselect.php |
---|
15,9 → 15,10 |
// +----------------------------------------------------------------------+ |
// | Authors: Herim Vasquez <vasquezh@iro.umontreal.ca> | |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// | Alexey Borzov <avb@php.net> |
// +----------------------------------------------------------------------+ |
// |
// $Id: hierselect.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: hierselect.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/group.php'); |
require_once('HTML/QuickForm/select.php'); |
97,11 → 98,6 |
* @access private |
*/ |
var $_js = ''; |
/** |
* The javascript array name |
*/ |
var $_jsArrayName = ''; |
// }}} |
// {{{ constructor |
159,7 → 155,6 |
} |
$this->_setOptions(); |
$this->_setJS(); |
} // end func setMainOptions |
// }}} |
213,7 → 208,6 |
} |
$this->_setOptions(); |
$this->_setJS(); |
} // end func setSecOptions |
// }}} |
229,16 → 223,14 |
{ |
$toLoad = ''; |
foreach (array_keys($this->_elements) AS $key) { |
if (eval("return isset(\$this->_options[{$key}]{$toLoad});") ) { |
$array = eval("return \$this->_options[{$key}]{$toLoad};"); |
if (is_array($array)) { |
$select =& $this->_elements[$key]; |
$select->_options = array(); |
$select->loadArray($array); |
$array = eval("return isset(\$this->_options[{$key}]{$toLoad})? \$this->_options[{$key}]{$toLoad}: null;"); |
if (is_array($array)) { |
$select =& $this->_elements[$key]; |
$select->_options = array(); |
$select->loadArray($array); |
$value = is_array($v = $select->getValue()) ? $v[0] : key($array); |
$toLoad .= '[\''.$value.'\']'; |
} |
$value = is_array($v = $select->getValue()) ? $v[0] : key($array); |
$toLoad .= '[\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $value) . '\']'; |
} |
} |
} // end func _setOptions |
279,132 → 271,177 |
} // end func _createElements |
// }}} |
// {{{ _setJS() |
/** |
* Set the JavaScript for each select element (excluding de main one). |
* |
* @access private |
* @return void |
*/ |
function _setJS() |
{ |
$this->_js = $js = ''; |
$this->_jsArrayName = 'hs_' . $this->getName(); |
for ($i = 1; $i < $this->_nbElements; $i++) { |
$this->_setJSArray($this->_jsArrayName, $this->_options[$i], $js); |
} |
} // end func _setJS |
// }}} |
// {{{ _setJSArray() |
/** |
* Recursively builds the JavaScript array defining the options that a select |
* element can have. |
* |
* @param string $grpName Group Name attribute |
* @param array $options Select element options |
* @param string $js JavaScript definition is build using this variable |
* @param string $optValue The value for the current JavaScript option |
* |
* @access private |
* @return void |
*/ |
function _setJSArray($grpName, $options, &$js, $optValue = '') |
{ |
if (is_array($options)) { |
$js = ''; |
// For a hierselect containing 3 elements: |
// if option 1 has been selected for the 1st element |
// and option 3 has been selected for the 2nd element, |
// then the javascript array containing the values to load |
// on the 3rd element will have the following name: grpName_1_3 |
$name = ($optValue === '') ? $grpName : $grpName.'_'.$optValue; |
foreach($options AS $k => $v) { |
$this->_setJSArray($name, $v, $js, $k); |
} |
// if $js !== '' add it to the JavaScript |
$this->_js .= ($js !== '') ? $name." = {\n".$js."\n}\n" : ''; |
$js = ''; |
} else { |
// $js empty means that we are adding the first element to the JavaScript. |
if ($js != '') { |
$js .= ",\n"; |
} |
$js .= '"'.$optValue.'":"'.$options.'"'; |
} |
} |
// }}} |
// {{{ toHtml() |
/** |
* Returns Html for the group |
* |
* @access public |
* @return string |
*/ |
function toHtml() |
{ |
if ($this->_flagFrozen) { |
$this->_js = ''; |
} else { |
// set the onchange attribute for each element |
$keys = array_keys($this->_elements); |
$nbElements = count($keys); |
$nbElementsUsingFnc = $nbElements - 1; // last element doesn't need it |
for ($i = 0; $i < $nbElementsUsingFnc; $i++) { |
$this->_js = ''; |
if (!$this->_flagFrozen) { |
// set the onchange attribute for each element except last |
$keys = array_keys($this->_elements); |
$onChange = array(); |
for ($i = 0; $i < count($keys) - 1; $i++) { |
$select =& $this->_elements[$keys[$i]]; |
$onChange[$i] = $select->getAttribute('onchange'); |
$select->updateAttributes( |
array('onChange' => 'swapOptions(this, \''.$this->getName().'\', '.$keys[$i].', '.$nbElements.', \''.$this->_jsArrayName.'\');') |
array('onchange' => '_hs_swapOptions(this.form, \'' . $this->_escapeString($this->getName()) . '\', ' . $keys[$i] . ');' . $onChange[$i]) |
); |
} |
// create the js function to call |
if (!defined('HTML_QUICKFORM_HIERSELECT_EXISTS')) { |
$this->_js .= "function swapOptions(frm, grpName, eleIndex, nbElements, arName)\n" |
."{\n" |
." var n = \"\";\n" |
." var ctl;\n\n" |
." for (var i = 0; i < nbElements; i++) {\n" |
." ctl = frm.form[grpName+'['+i+']'];\n" |
." if (!ctl) {\n" |
." ctl = frm.form[grpName+'['+i+'][]'];\n" |
." }\n" |
." if (i <= eleIndex) {\n" |
." n += \"_\"+ctl.value;\n" |
." } else {\n" |
." ctl.length = 0;\n" |
." }\n" |
." }\n\n" |
." var t = eval(\"typeof(\"+arName + n +\")\");\n" |
." if (t != 'undefined') {\n" |
." var the_array = eval(arName+n);\n" |
." var j = 0;\n" |
." n = eleIndex + 1;\n" |
." ctl = frm.form[grpName+'['+ n +']'];\n" |
." if (!ctl) {\n" |
." ctl = frm.form[grpName+'['+ n +'][]'];\n" |
." }\n" |
." for (var i in the_array) {\n" |
." opt = new Option(the_array[i], i, false, false);\n" |
." ctl.options[j++] = opt;\n" |
." }\n" |
." }\n" |
." if (eleIndex+1 < nbElements) {\n" |
." swapOptions(frm, grpName, eleIndex+1, nbElements, arName);\n" |
." }\n" |
."}\n"; |
$this->_js .= <<<JAVASCRIPT |
function _hs_findOptions(ary, keys) |
{ |
var key = keys.shift(); |
if (!key in ary) { |
return {}; |
} else if (0 == keys.length) { |
return ary[key]; |
} else { |
return _hs_findOptions(ary[key], keys); |
} |
} |
function _hs_findSelect(form, groupName, selectIndex) |
{ |
if (groupName+'['+ selectIndex +']' in form) { |
return form[groupName+'['+ selectIndex +']']; |
} else { |
return form[groupName+'['+ selectIndex +'][]']; |
} |
} |
function _hs_replaceOptions(ctl, optionList) |
{ |
var j = 0; |
ctl.options.length = 0; |
for (i in optionList) { |
ctl.options[j++] = new Option(optionList[i], i, false, false); |
} |
} |
function _hs_setValue(ctl, value) |
{ |
var testValue = {}; |
if (value instanceof Array) { |
for (var i = 0; i < value.length; i++) { |
testValue[value[i]] = true; |
} |
} else { |
testValue[value] = true; |
} |
for (var i = 0; i < ctl.options.length; i++) { |
if (ctl.options[i].value in testValue) { |
ctl.options[i].selected = true; |
} |
} |
} |
function _hs_swapOptions(form, groupName, selectIndex) |
{ |
var hsValue = []; |
for (var i = 0; i <= selectIndex; i++) { |
hsValue[i] = _hs_findSelect(form, groupName, i).value; |
} |
_hs_replaceOptions(_hs_findSelect(form, groupName, selectIndex + 1), |
_hs_findOptions(_hs_options[groupName][selectIndex], hsValue)); |
if (selectIndex + 1 < _hs_options[groupName].length) { |
_hs_swapOptions(form, groupName, selectIndex + 1); |
} |
} |
function _hs_onReset(form, groupNames) |
{ |
for (var i = 0; i < groupNames.length; i++) { |
try { |
for (var j = 0; j <= _hs_options[groupNames[i]].length; j++) { |
_hs_setValue(_hs_findSelect(form, groupNames[i], j), _hs_defaults[groupNames[i]][j]); |
if (j < _hs_options[groupNames[i]].length) { |
_hs_replaceOptions(_hs_findSelect(form, groupNames[i], j + 1), |
_hs_findOptions(_hs_options[groupNames[i]][j], _hs_defaults[groupNames[i]].slice(0, j + 1))); |
} |
} |
} catch (e) { |
if (!(e instanceof TypeError)) { |
throw e; |
} |
} |
} |
} |
function _hs_setupOnReset(form, groupNames) |
{ |
setTimeout(function() { _hs_onReset(form, groupNames); }, 25); |
} |
function _hs_onReload() |
{ |
var ctl; |
for (var i = 0; i < document.forms.length; i++) { |
for (var j in _hs_defaults) { |
if (ctl = _hs_findSelect(document.forms[i], j, 0)) { |
for (var k = 0; k < _hs_defaults[j].length; k++) { |
_hs_setValue(_hs_findSelect(document.forms[i], j, k), _hs_defaults[j][k]); |
} |
} |
} |
} |
if (_hs_prevOnload) { |
_hs_prevOnload(); |
} |
} |
var _hs_prevOnload = null; |
if (window.onload) { |
_hs_prevOnload = window.onload; |
} |
window.onload = _hs_onReload; |
var _hs_options = {}; |
var _hs_defaults = {}; |
JAVASCRIPT; |
define('HTML_QUICKFORM_HIERSELECT_EXISTS', true); |
} |
// option lists |
$jsParts = array(); |
for ($i = 1; $i < $this->_nbElements; $i++) { |
$jsParts[] = $this->_convertArrayToJavascript($this->_options[$i]); |
} |
$this->_js .= "\n_hs_options['" . $this->_escapeString($this->getName()) . "'] = [\n" . |
implode(",\n", $jsParts) . |
"\n];\n"; |
// default value; if we don't actually have any values yet just use |
// the first option (for single selects) or empty array (for multiple) |
$values = array(); |
foreach (array_keys($this->_elements) as $key) { |
if (is_array($v = $this->_elements[$key]->getValue())) { |
$values[] = count($v) > 1? $v: $v[0]; |
} else { |
// XXX: accessing the supposedly private _options array |
$values[] = $this->_elements[$key]->getMultiple() || empty($this->_elements[$key]->_options[0])? |
array(): |
$this->_elements[$key]->_options[0]['attr']['value']; |
} |
} |
$this->_js .= "_hs_defaults['" . $this->_escapeString($this->getName()) . "'] = " . |
$this->_convertArrayToJavascript($values, false) . ";\n"; |
} |
include_once('HTML/QuickForm/Renderer/Default.php'); |
$renderer =& new HTML_QuickForm_Renderer_Default(); |
$renderer->setElementTemplate('{element}'); |
parent::accept($renderer); |
return "<script type=\"text/javascript\">\n//<![CDATA[\n" . $this->_js . "//]]>\n</script>" . |
if (!empty($onChange)) { |
$keys = array_keys($this->_elements); |
for ($i = 0; $i < count($keys) - 1; $i++) { |
$this->_elements[$keys[$i]]->updateAttributes(array('onchange' => $onChange[$i])); |
} |
} |
return (empty($this->_js)? '': "<script type=\"text/javascript\">\n//<![CDATA[\n" . $this->_js . "//]]>\n</script>") . |
$renderer->toHtml(); |
} // end func toHtml |
411,15 → 448,6 |
// }}} |
// {{{ accept() |
/** |
* Accepts a renderer |
* |
* @param object An HTML_QuickForm_Renderer object |
* @param bool Whether a group is required |
* @param string An error message associated with a group |
* @access public |
* @return void |
*/ |
function accept(&$renderer, $required = false, $error = null) |
{ |
$renderer->renderElement($this, $required, $error); |
435,10 → 463,103 |
// matches the main option |
return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller); |
} else { |
return parent::onQuickFormEvent($event, $arg, $caller); |
$ret = parent::onQuickFormEvent($event, $arg, $caller); |
// add onreset handler to form to properly reset hierselect (see bug #2970) |
if ('addElement' == $event) { |
$onReset = $caller->getAttribute('onreset'); |
if (strlen($onReset)) { |
if (strpos($onReset, '_hs_setupOnReset')) { |
$caller->updateAttributes(array('onreset' => str_replace('_hs_setupOnReset(this, [', "_hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "', ", $onReset))); |
} else { |
$caller->updateAttributes(array('onreset' => "var temp = function() { {$onReset} } ; if (!temp()) { return false; } ; if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } ")); |
} |
} else { |
$caller->updateAttributes(array('onreset' => "if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } ")); |
} |
} |
return $ret; |
} |
} // end func onQuickFormEvent |
// }}} |
// }}} |
// {{{ _convertArrayToJavascript() |
/** |
* Converts PHP array to its Javascript analog |
* |
* @access private |
* @param array PHP array to convert |
* @param bool Generate Javascript object literal (default, works like PHP's associative array) or array literal |
* @return string Javascript representation of the value |
*/ |
function _convertArrayToJavascript($array, $assoc = true) |
{ |
if (!is_array($array)) { |
return $this->_convertScalarToJavascript($array); |
} else { |
$items = array(); |
foreach ($array as $key => $val) { |
$item = $assoc? "'" . $this->_escapeString($key) . "': ": ''; |
if (is_array($val)) { |
$item .= $this->_convertArrayToJavascript($val, $assoc); |
} else { |
$item .= $this->_convertScalarToJavascript($val); |
} |
$items[] = $item; |
} |
} |
$js = implode(', ', $items); |
return $assoc? '{ ' . $js . ' }': '[' . $js . ']'; |
} |
// }}} |
// {{{ _convertScalarToJavascript() |
/** |
* Converts PHP's scalar value to its Javascript analog |
* |
* @access private |
* @param mixed PHP value to convert |
* @return string Javascript representation of the value |
*/ |
function _convertScalarToJavascript($val) |
{ |
if (is_bool($val)) { |
return $val ? 'true' : 'false'; |
} elseif (is_int($val) || is_double($val)) { |
return $val; |
} elseif (is_string($val)) { |
return "'" . $this->_escapeString($val) . "'"; |
} elseif (is_null($val)) { |
return 'null'; |
} else { |
// don't bother |
return '{}'; |
} |
} |
// }}} |
// {{{ _escapeString() |
/** |
* Quotes the string so that it can be used in Javascript string constants |
* |
* @access private |
* @param string |
* @return string |
*/ |
function _escapeString($str) |
{ |
return strtr($str,array( |
"\r" => '\r', |
"\n" => '\n', |
"\t" => '\t', |
"'" => "\\'", |
'"' => '\"', |
'\\' => '\\\\' |
)); |
} |
// }}} |
} // end class HTML_QuickForm_hierselect |
?> |
/trunk/api/pear/HTML/QuickForm/header.php |
---|
16,7 → 16,7 |
// | Author: Alexey Borzov <borz_off@cs.msu.su> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: header.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: header.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once 'HTML/QuickForm/static.php'; |
/trunk/api/pear/HTML/QuickForm/element.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: element.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: element.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/Common.php'); |
245,10 → 245,11 |
return ''; |
} else { |
$id = $this->getAttribute('id'); |
return '<input type="hidden"' . |
(isset($id)? ' id="' . $id . '"': '') . |
' name="' . $this->getName() . '"' . |
' value="' . htmlspecialchars($this->getValue()) . '" />'; |
return '<input' . $this->_getAttrString(array( |
'type' => 'hidden', |
'name' => $this->getName(), |
'value' => $this->getValue() |
) + (isset($id)? array('id' => $id): array())) . ' />'; |
} |
} |
/trunk/api/pear/HTML/QuickForm/hidden.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: hidden.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: hidden.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/input.php"); |
/trunk/api/pear/HTML/QuickForm/hiddenselect.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: hiddenselect.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: hiddenselect.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once('HTML/QuickForm/select.php'); |
79,7 → 79,11 |
foreach ($this->_values as $key => $val) { |
for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) { |
if ($val == $this->_options[$i]['attr']['value']) { |
$strHtml .= $tabs . '<input type="hidden" name="' . $name . '" value="' . $val . '" />' . "\n"; |
$strHtml .= $tabs . '<input' . $this->_getAttrString(array( |
'type' => 'hidden', |
'name' => $name, |
'value' => $val |
)) . " />\n" ; |
} |
} |
} |
/trunk/api/pear/HTML/QuickForm/group.php |
---|
17,7 → 17,7 |
// | Bertrand Mansion <bmansion@mamasam.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: group.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
// $Id: group.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
require_once("HTML/QuickForm/element.php"); |
151,9 → 151,7 |
*/ |
function setValue($value) |
{ |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
foreach (array_keys($this->_elements) as $key) { |
if (!$this->_appendName) { |
$v = $this->_elements[$key]->_findValue($value); |
163,7 → 161,7 |
} else { |
$elementName = $this->_elements[$key]->getName(); |
$index = (!empty($elementName)) ? $elementName : $key; |
$index = strlen($elementName) ? $elementName : $key; |
if (is_array($value)) { |
if (isset($value[$index])) { |
$this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this); |
208,7 → 206,7 |
if (!is_array($value)) { |
$value = is_null($value)? array(): array($value); |
} |
if ('' == $elementName) { |
if ('' === $elementName) { |
$value[] = $v; |
} else { |
$value[$elementName] = $v; |
250,6 → 248,7 |
*/ |
function &getElements() |
{ |
$this->_createElementsIfNotExist(); |
return $this->_elements; |
} // end func getElements |
266,9 → 265,7 |
*/ |
function getGroupType() |
{ |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
$prevType = ''; |
foreach (array_keys($this->_elements) as $key) { |
$type = $this->_elements[$key]->getType(); |
312,9 → 309,7 |
*/ |
function getElementName($index) |
{ |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
$elementName = false; |
if (is_int($index) && isset($this->_elements[$index])) { |
$elementName = $this->_elements[$index]->getName(); |
358,9 → 353,7 |
function getFrozenHtml() |
{ |
$flags = array(); |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
foreach (array_keys($this->_elements) as $key) { |
if (false === ($flags[$key] = $this->_elements[$key]->isFrozen())) { |
$this->_elements[$key]->freeze(); |
392,15 → 385,13 |
{ |
switch ($event) { |
case 'updateValue': |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
foreach (array_keys($this->_elements) as $key) { |
if ($this->_appendName) { |
$elementName = $this->_elements[$key]->getName(); |
if (is_null($elementName)) { |
$this->_elements[$key]->setName($this->getName()); |
} elseif ('' == $elementName) { |
} elseif ('' === $elementName) { |
$this->_elements[$key]->setName($this->getName() . '[' . $key . ']'); |
} else { |
$this->_elements[$key]->setName($this->getName() . '[' . $elementName . ']'); |
433,9 → 424,7 |
*/ |
function accept(&$renderer, $required = false, $error = null) |
{ |
if (empty($this->_elements)) { |
$this->_createElements(); |
} |
$this->_createElementsIfNotExist(); |
$renderer->startGroup($this, $required, $error); |
$name = $this->getName(); |
foreach (array_keys($this->_elements) as $key) { |
477,7 → 466,7 |
if ($this->_appendName) { |
if (is_null($elementName)) { |
$this->_elements[$key]->setName($this->getName()); |
} elseif ('' == $elementName) { |
} elseif ('' === $elementName) { |
$this->_elements[$key]->setName($this->getName() . '[' . $key . ']'); |
} else { |
$this->_elements[$key]->setName($this->getName() . '[' . $elementName . ']'); |
499,7 → 488,7 |
// just like getValue(), but should work OK every time here |
if (is_null($elementName)) { |
$value = $v; |
} elseif ('' == $elementName) { |
} elseif ('' === $elementName) { |
$value[] = $v; |
} else { |
$value[$elementName] = $v; |
531,6 → 520,28 |
} |
// }}} |
// {{{ _createElementsIfNotExist() |
/** |
* A wrapper around _createElements() |
* |
* This method calls _createElements() if the group's _elements array |
* is empty. It also performs some updates, e.g. freezes the created |
* elements if the group is already frozen. |
* |
* @access private |
*/ |
function _createElementsIfNotExist() |
{ |
if (empty($this->_elements)) { |
$this->_createElements(); |
if ($this->_flagFrozen) { |
$this->freeze(); |
} |
} |
} |
// }}} |
// {{{ freeze() |
function freeze() |
/trunk/api/pear/DB/ibase.php |
---|
23,7 → 23,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: ibase.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: ibase.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
49,7 → 49,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
* @since Class became stable in Release 1.7.0 |
*/ |
/trunk/api/pear/DB/storage.php |
---|
18,7 → 18,7 |
* @author Stig Bakken <stig@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: storage.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: storage.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
38,7 → 38,7 |
* @author Stig Bakken <stig@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_storage extends PEAR |
/trunk/api/pear/DB/mysql.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: mysql.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: mysql.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
41,7 → 41,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_mysql extends DB_common |
/trunk/api/pear/DB/ifx.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: ifx.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: ifx.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
48,7 → 48,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_ifx extends DB_common |
/trunk/api/pear/DB/pgsql.php |
---|
21,7 → 21,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: pgsql.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: pgsql.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
43,7 → 43,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_pgsql extends DB_common |
/trunk/api/pear/DB/sybase.php |
---|
21,7 → 21,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: sybase.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: sybase.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
46,7 → 46,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_sybase extends DB_common |
/trunk/api/pear/DB/fbsql.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: fbsql.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: fbsql.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
41,7 → 41,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
* @since Class functional since Release 1.7.0 |
*/ |
/trunk/api/pear/DB/odbc.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: odbc.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: odbc.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
44,7 → 44,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_odbc extends DB_common |
/trunk/api/pear/DB/common.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: common.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: common.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
42,7 → 42,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_common extends PEAR |
479,10 → 479,8 |
/** |
* Sets the fetch mode that should be used by default for query results |
* |
* @param integer $fetchmode DB_FETCHMODE_ORDERED or DB_FETCHMODE_ASSOC, |
* possibly bit-wise OR'ed with |
* DB_FETCHMODE_FLIPPED |
* |
* @param integer $fetchmode DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC |
* or DB_FETCHMODE_OBJECT |
* @param string $object_class the class name of the object to be returned |
* by the fetch methods when the |
* DB_FETCHMODE_OBJECT mode is selected. |
491,8 → 489,7 |
* done. There is also the posibility to use |
* and extend the 'DB_row' class. |
* |
* @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_FLIPPED, |
* DB_FETCHMODE_OBJECT |
* @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT |
*/ |
function setFetchMode($fetchmode, $object_class = 'stdClass') |
{ |
1571,7 → 1568,11 |
* placeholders in query: meaning 1 |
* placeholder for non-array parameters or |
* 1 placeholder per array element. |
* @param int $fetchmode the fetch mode to use |
* @param int $fetchmode the fetch mode to use: |
* + DB_FETCHMODE_ORDERED |
* + DB_FETCHMODE_ASSOC |
* + DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED |
* + DB_FETCHMODE_ASSOC | DB_FETCHMODE_FLIPPED |
* |
* @return array the nested array. A DB_Error object on failure. |
*/ |
/trunk/api/pear/DB/msql.php |
---|
23,7 → 23,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: msql.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: msql.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
47,7 → 47,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
* @since Class not functional until Release 1.7.0 |
*/ |
/trunk/api/pear/DB/dbase.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: dbase.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: dbase.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
41,7 → 41,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_dbase extends DB_common |
/trunk/api/pear/DB/mysqli.php |
---|
19,7 → 19,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: mysqli.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: mysqli.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
43,7 → 43,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
* @since Class functional since Release 1.6.3 |
*/ |
/trunk/api/pear/DB/mssql.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: mssql.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: mssql.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
41,7 → 41,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_mssql extends DB_common |
/trunk/api/pear/DB/sqlite.php |
---|
21,7 → 21,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 |
* @version CVS: $Id: sqlite.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: sqlite.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
47,7 → 47,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_sqlite extends DB_common |
/trunk/api/pear/DB/oci8.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: oci8.php,v 1.1 2005-03-30 08:50:33 jpm Exp $ |
* @version CVS: $Id: oci8.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
47,7 → 47,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_oci8 extends DB_common |
225,10 → 225,18 |
$connect_function = $persistent ? 'oci_pconnect' |
: 'oci_connect'; |
} |
// Backwards compatibility with DB < 1.7.0 |
if (empty($dsn['database']) && !empty($dsn['hostspec'])) { |
$db = $dsn['hostspec']; |
} else { |
$db = $dsn['database']; |
} |
$char = empty($dsn['charset']) ? null : $dsn['charset']; |
$this->connection = @$connect_function($dsn['username'], |
$dsn['password'], |
$dsn['database'], |
$db, |
$char); |
$error = OCIError(); |
if (!empty($error) && $error['code'] == 12541) { |
/trunk/api/pear/A_LIRE.txt |
---|
2,9 → 2,9 |
============================== |
Package Version State |
Auth 1.2.3 stable |
DB 1.7.5 stable |
DB 1.7.6 stable |
HTML_Common 1.2.1 stable |
HTML_QuickForm 3.2.4pl1 stable |
HTML_QuickForm 3.2.5 stable |
HTML_Table 1.5 stable |
HTTP 1.3.5 stable |
Net_FTP 1.3.0 stable |
/trunk/api/pear/DB.php |
---|
20,7 → 20,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version CVS: $Id: DB.php,v 1.1 2005-03-30 08:50:19 jpm Exp $ |
* @version CVS: $Id: DB.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $ |
* @link http://pear.php.net/package/DB |
*/ |
426,7 → 426,7 |
* @author Daniel Convissor <danielc@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB |
572,7 → 572,7 |
*/ |
function apiVersion() |
{ |
return '1.7.5'; |
return '@package_version@'; |
} |
// }}} |
862,7 → 862,7 |
* @author Stig Bakken <ssb@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_Error extends PEAR_Error |
909,7 → 909,7 |
* @author Stig Bakken <ssb@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
*/ |
class DB_result |
1351,7 → 1351,7 |
* @author Stig Bakken <ssb@php.net> |
* @copyright 1997-2005 The PHP Group |
* @license http://www.php.net/license/3_0.txt PHP License 3.0 |
* @version Release: 1.7.5 |
* @version Release: @package_version@ |
* @link http://pear.php.net/package/DB |
* @see DB_common::setFetchMode() |
*/ |
/trunk/api/debogage/BOG_Gestionnaire_Erreur.class.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: BOG_Gestionnaire_Erreur.class.php,v 1.3 2004-11-29 15:56:23 jpm Exp $ |
// CVS : $Id: BOG_Gestionnaire_Erreur.class.php,v 1.4 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Classe permettant de créer un gestionnaire d'erreur PHP |
* |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.3 $ $Date: 2004-11-29 15:56:23 $ |
*@version $Revision: 1.4 $ $Date: 2005-09-20 17:01:22 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
69,6 → 69,7 |
if (! empty($class)) { |
$this->ecrireClass($class); |
} |
set_error_handler(array(&$this, 'gererErreur')); |
} |
138,15 → 139,27 |
// Méthode |
function gererErreur($niveau, $message, $fichier, $ligne, $contexte) |
{ |
$aso_erreur = array(); |
$aso_erreur['niveau'] = $niveau; |
$aso_erreur['message'] = $message; |
$aso_erreur['fichier'] = $fichier; |
$aso_erreur['ligne'] = $ligne; |
if ($this->lireContexte()) { |
$aso_erreur['contexte'] = $contexte; |
} |
$this->ecrireErreur($aso_erreur); |
// Ouais bof le test, mais php5 renvoie vraiment trop de message d'erreur sur Deprecated ... et |
// ca concerne essentiellement les classes pear ! |
if (!defined('E_STRICT')) { |
define("E_STRICT", 2048); |
} |
if ($niveau < E_STRICT) { |
$aso_erreur = array(); |
$aso_erreur['niveau'] = $niveau; |
$aso_erreur['message'] = $message; |
$aso_erreur['fichier'] = $fichier; |
$aso_erreur['ligne'] = $ligne; |
if ($this->lireContexte()) { |
$aso_erreur['contexte'] = $contexte; |
} |
$this->ecrireErreur($aso_erreur); |
} |
} |
function retournerErreurs() |
178,6 → 191,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.3 2004/11/29 15:56:23 jpm |
* Correction bogue. |
* |
* Revision 1.2 2004/11/29 15:54:16 jpm |
* Changement de nom de variable et légère correction. |
* |
/trunk/client/integrateur_wikini/integrateur_wikini.php |
---|
21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: integrateur_wikini.php,v 1.6 2005-09-14 09:12:15 ddelon Exp $ |
// CVS : $Id: integrateur_wikini.php,v 1.7 2005-09-20 17:01:22 ddelon Exp $ |
/** |
* Integrateur de page Wikini |
* |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.6 $ $Date: 2005-09-14 09:12:15 $ |
*@version $Revision: 1.7 $ $Date: 2005-09-20 17:01:22 $ |
* |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
208,7 → 208,7 |
} |
else { |
return Parent::Method($method); |
return parent::Method($method); |
} |
} |
250,7 → 250,6 |
// Autre possibilite : la page speciale MENU |
global $wiki; |
global $wikini_config_defaut; |
$sortie=''; |