/tags/v3.1-blanche-neige/upload/vide.txt |
---|
--- v3.1-blanche-neige/bazar.head.php (revision 0) |
+++ v3.1-blanche-neige/bazar.head.php (revision 470) |
@@ -0,0 +1,14 @@ |
+<?php |
+include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
+ |
+$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature' ; |
+$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
+if (DB::isError($resultat)) { |
+ die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ; |
+} |
+echo '<link rel="alternate" type="application/rss+xml" title="'.BAZ_TOUTES_LES_ANNONCES.'" href="http://'.$_SERVER['HTTP_HOST'].'/bazar/bazarRSS.php" />'."\n"; |
+while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
+ echo '<link rel="alternate" type="application/rss+xml" title="'.$ligne['bn_label_nature'].'" href="http://'.$_SERVER['HTTP_HOST'].'/bazar/bazarRSS.php?annonce='.$ligne['bn_label_nature'].'" />'."\n"; |
+} |
+ |
+?> |
/tags/v3.1-blanche-neige/bazar.php |
---|
New file |
0,0 → 1,518 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This library is free software; you can redistribute it and/or | |
// | modify it under the terms of the GNU Lesser General Public | |
// | License as published by the Free Software Foundation; either | |
// | version 2.1 of the License, or (at your option) any later version. | |
// | | |
// | This library is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
// | Lesser General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU Lesser General Public | |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.php,v 1.49.2.4 2008-02-04 13:10:15 alexandre_tb Exp $ |
/** |
* |
*@package bazar |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.49.2.4 $ $Date: 2008-02-04 13:10:15 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
//error_reporting(E_ALL); |
require_once PAP_CHEMIN_API_PEAR.'DB.php' ; |
require_once PAP_CHEMIN_API_PEAR.'Auth.php' ; |
require_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar |
require_once 'bibliotheque/bazar.class.php'; |
require_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar |
if (defined('PAP_VERSION')) { //si on est dans Papyrus |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css'); |
} |
//********************************************************************************************************** |
//initialisation des paramêtres papyrus |
//********************************************************************************************************** |
//si un parametre est précisé dans le gestionnaire de menus papyrus, on le prends en compte |
//parametre action pour lancer directement l'action indiquée |
if (!isset($_GET[BAZ_VARIABLE_ACTION])and(isset($GLOBALS['_GEN_commun']['info_application']->action))) { |
$_GET[BAZ_VARIABLE_ACTION]=$GLOBALS['_GEN_commun']['info_application']->action; |
} |
//parametre vue pour afficher directement une vue |
if (!isset($_GET[BAZ_VARIABLE_VOIR])and(isset($GLOBALS['_GEN_commun']['info_application']->vue))) { |
$_GET[BAZ_VARIABLE_VOIR]=$GLOBALS['_GEN_commun']['info_application']->vue; |
} |
// Si le parametre vue est vide on le positionne a 1 |
if (!isset($_GET[BAZ_VARIABLE_VOIR])) { |
$_GET[BAZ_VARIABLE_VOIR] = BAZ_VOIR_CONSULTER; |
} |
if(!isset($GLOBALS['_BAZAR_']['mois'])) |
{ |
$GLOBALS['mois'] = array (1 => BAZ_JANVIER, 2 => BAZ_FEVRIER, 3 => BAZ_MARS, 4 => BAZ_AVRIL, 5 => BAZ_MAI, 6 => BAZ_JUIN, |
7 => BAZ_JUILLET, 8 => BAZ_AOUT, 9 => BAZ_SEPTEMBRE, 10 => BAZ_OCTOBRE, 11 =>BAZ_NOVEMBRE, |
12 => BAZ_DECEMBRE) ; |
} |
//parametre voir_menu pour afficher le menu ou pas (par défaut, il l'affiche) |
if ((isset($GLOBALS['_GEN_commun']['info_application']->voir_menu))and($GLOBALS['_GEN_commun']['info_application']->voir_menu==0)) { |
$GLOBALS['_BAZAR_']['affiche_menu']=0; |
} |
else $GLOBALS['_BAZAR_']['affiche_menu']=1; |
//parametre categorie_nature pour préciser quels types de fiches sont montrees (par défaut, il affiche les id_menu=0) |
if (isset($GLOBALS['_GEN_commun']['info_application']->categorie_nature)) { |
$GLOBALS['_BAZAR_']['categorie_nature']=$GLOBALS['_GEN_commun']['info_application']->categorie_nature; |
} |
elseif (isset($_REQUEST['categorie_nature'])) { |
$GLOBALS['_BAZAR_']['categorie_nature']=$_REQUEST['categorie_nature']; |
} |
else $GLOBALS['_BAZAR_']['categorie_nature']=0; |
//parametre id_nature pour afficher un certain type de fiche (par défaut, tous les types de fiches) |
if (isset($GLOBALS['_GEN_commun']['info_application']->id_nature)) { |
$GLOBALS['_BAZAR_']['id_typeannonce']=$GLOBALS['_GEN_commun']['info_application']->id_nature; |
} |
elseif (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce']='toutes'; |
//********************************************************************************************************** |
//initialisation de la variable globale de bazar |
//********************************************************************************************************** |
$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID); |
//Recuperer les eventuelles variables passees en GET ou en POST |
if (isset($_REQUEST['id_fiche'])) { |
$GLOBALS['_BAZAR_']['id_fiche'] = $_REQUEST['id_fiche']; |
// récupération du type d'annonce à partir de la fiche |
$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$_REQUEST['id_fiche'] ; |
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$GLOBALS['_BAZAR_']['id_typeannonce'] = $ligne->bf_ce_nature ; |
$resultat->free(); |
} |
if (isset($_REQUEST['typeannonce']) && $_REQUEST['typeannonce'] != '1,2,3,4') { |
$GLOBALS['_BAZAR_']['id_typeannonce'] = $_REQUEST['typeannonce']; |
} |
else |
{ |
$GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ; |
} |
if (isset($_REQUEST['liste31'])) { |
if($_REQUEST['liste31'] == "0") |
{ |
$GLOBALS['_BAZAR_']['id_typeannonce']= 'toutes' ; |
} |
else |
{ |
$GLOBALS['_BAZAR_']['id_typeannonce']= $_REQUEST['liste31']; |
} |
} |
else |
{ |
$GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ; |
} |
if ((isset($GLOBALS['_BAZAR_']['id_typeannonce']))and($GLOBALS['_BAZAR_']['id_typeannonce']!='toutes')) { |
$typeAnnonce = false; |
$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo '. |
'FROM bazar_nature '; |
if (isset($GLOBALS['_BAZAR_']['id_typeannonce']) && !empty($GLOBALS['_BAZAR_']['id_typeannonce']) && isset($GLOBALS['_BAZAR_']['id_typeannonce']) != 'toutes') { |
$requete .= 'WHERE bn_id_nature = '.$GLOBALS['_BAZAR_']['id_typeannonce']; |
$typeAnnonce = true; |
} |
if (isset($GLOBALS['_BAZAR_']['langue'])) { |
if (!$typeAnnonce) { |
$requete .= ' WHERE '; |
} else { |
$requete .= ' AND '; |
} |
$requete .= 'bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%"'; |
} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature']; |
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition']; |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template']; |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire']; |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation']; |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre']; |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo']; |
} |
else |
{ |
$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo '. |
'FROM bazar_nature '; |
$requete .= 'WHERE bn_id_nature = 1'; |
$typeAnnonce = true; |
if (isset($GLOBALS['_BAZAR_']['langue'])) { |
if (!$typeAnnonce) { |
$requete .= ' WHERE '; |
} else { |
$requete .= ' AND '; |
} |
$requete .= 'bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%"'; |
} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC); |
$GLOBALS['_BAZAR_']['typeannonce']= 'toutes' ; |
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition']; |
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template']; |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire']; |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation']; |
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre']; |
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo']; |
} |
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ; |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
if ($GLOBALS['_BAZAR_']['affiche_menu']) { |
//---------------le menu de l'appli----------- |
function afficherContenuNavigation () { |
$res ='<ul class="onglets" id="BAZ_menu">'."\n"; |
// Gestion de la vue par défaut |
if (!isset($_GET[BAZ_VARIABLE_VOIR])) { |
$_GET[BAZ_VARIABLE_VOIR] = BAZ_VOIR_DEFAUT; |
} |
//partie consultation d'annonces |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_CONSULTER))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_CONSULTER); |
$res .= '<li id="consulter"'; |
if ((isset($_GET[BAZ_VARIABLE_VOIR]) && $_GET[BAZ_VARIABLE_VOIR] == BAZ_VOIR_CONSULTER)) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n"; |
} |
// Mes fiches |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_MES_FICHES))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_MES_FICHES); |
$res .= '<li id="mes_fiches"'; |
if (isset($_GET[BAZ_VARIABLE_VOIR]) && $_GET[BAZ_VARIABLE_VOIR] == BAZ_VOIR_MES_FICHES) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOIR_VOS_ANNONCES.'</a>'."\n".'</li>'."\n"; |
} |
//partie abonnement aux annonces |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_S_ABONNER))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_S_ABONNER); |
$res .= '<li id="inscrire"'; |
if (isset($_GET[BAZ_VARIABLE_VOIR]) && $_GET[BAZ_VARIABLE_VOIR]==BAZ_VOIR_S_ABONNER) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .= '><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ; |
} |
//partie saisie d'annonces |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_SAISIR))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_SAISIR); |
$res .= '<li id="deposer"'; |
if (isset($_GET[BAZ_VARIABLE_VOIR]) && ($_GET[BAZ_VARIABLE_VOIR]==BAZ_VOIR_SAISIR )) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_SAISIR.'</a>'."\n".'</li>'."\n"; |
} |
//choix des administrateurs |
$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ; |
$est_admin=0; |
if ($GLOBALS['AUTH']->getAuth()) { |
$requete='SELECT bn_id_nature FROM bazar_nature'; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($utilisateur->isAdmin ($ligne['bn_id_nature'])) { |
$est_admin=1; |
} |
} |
if ($est_admin || $utilisateur->isSuperAdmin()) { |
//partie administrer |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_ADMIN))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_ADMIN); |
$res .= '<li id="administrer"'; |
if (isset($_GET[BAZ_VARIABLE_VOIR]) && $_GET[BAZ_VARIABLE_VOIR]==BAZ_VOIR_ADMIN) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a></li>'."\n"; |
} |
if ($utilisateur->isSuperAdmin()) { |
if (strstr(BAZ_VOIR_AFFICHER, strval(BAZ_VOIR_GESTION_DROITS))) { |
$GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_GESTION_DROITS); |
$res .= '<li id="gerer"'; |
if (isset($_GET[BAZ_VARIABLE_VOIR]) && $_GET[BAZ_VARIABLE_VOIR]==BAZ_VOIR_GESTION_DROITS) { $res .=' class="menu_actif" '; } else { $res .=' class="menu_inactif" '; } |
$res .='><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ; |
} |
} |
} |
} |
// Au final, on place dans l url, l action courante |
if (isset($_GET[BAZ_VARIABLE_VOIR])) $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, $_GET[BAZ_VARIABLE_VOIR]); |
$res.= '</ul>'."\n"; |
return $res ; |
} |
} |
function afficherContenuCorps() { |
$res = ''; |
$res.='<h1 id="titre_bazar">'.$GLOBALS['_GEN_commun']['info_menu']->gm_titre.'</h1>'."\n"; |
// La resolution des actions ci-dessous AVANT l afichage des vues afin |
// d afficher des vues correctes |
if (isset($_GET[BAZ_VARIABLE_ACTION])) { |
if (($_GET[BAZ_VARIABLE_ACTION]!=BAZ_ACTION_NOUVEAU_V)and($_GET[BAZ_VARIABLE_ACTION]!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']); |
switch ($_GET[BAZ_VARIABLE_ACTION]) { |
case BAZ_ACTION_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break; |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break; |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break; |
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break; |
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break; |
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break; |
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression(); unset ($_GET['action']); break; |
case BAZ_ACTION_PUBLIER : publier_fiche(1) ; break; |
case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break; |
case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break; |
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=UTF-8');include("bazarRSS.php");exit(0);break; |
case BAZ_ACTION_POST_VALIDATION : $res .= baz_post_validation();break; |
} |
} |
if (isset ($_GET[BAZ_VARIABLE_VOIR])) { |
switch ($_GET[BAZ_VARIABLE_VOIR]) { |
case BAZ_VOIR_CONSULTER: |
if (isset ($_GET[BAZ_VARIABLE_ACTION]) && $_GET[BAZ_VARIABLE_ACTION] != BAZ_VOIR_TOUTES_ANNONCES) { |
$res .= baz_formulaire($_GET[BAZ_VARIABLE_ACTION]) ; |
if ($_GET[BAZ_VARIABLE_ACTION] == BAZ_ACTION_MODIFIER_V) $res .= baz_voir_fiche(1); |
} else $res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); |
break; |
case BAZ_VOIR_MES_FICHES : |
if (isset ($_GET[BAZ_VARIABLE_ACTION])) $res .= baz_formulaire($_GET[BAZ_VARIABLE_ACTION]) ; else $res .= mes_fiches(); |
break; |
case BAZ_VOIR_S_ABONNER : $res .= baz_s_inscrire(); |
break; |
case BAZ_VOIR_SAISIR : |
if (isset ($_GET[BAZ_VARIABLE_ACTION])) $res .= baz_formulaire($_GET[BAZ_VARIABLE_ACTION]) ; else $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); |
break; |
case BAZ_VOIR_ADMIN: |
if (isset($_GET[BAZ_VARIABLE_ACTION])) $res .= baz_formulaire($_GET[BAZ_VARIABLE_ACTION]) ; else $res .= fiches_a_valider(); |
break; |
case BAZ_VOIR_GESTION_DROITS: $res .= baz_gestion_droits(); |
break; |
default : |
$res .= baz_liste($GLOBALS['_BAZAR_']['id_typeannonce']); |
} |
} |
return $res ; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.49.2.3 2008-01-29 09:43:19 alexandre_tb |
* Utilisation d un redirection pour eviter que les formulaires soient valides 2 fois |
* |
* Revision 1.49.2.2 2008-01-11 14:07:39 alexandre_tb |
* Remplacement de la variable action ecrite en dur par la constante BAZ_VARIABLE_ACTION |
* |
* Revision 1.49.2.1 2007-12-04 09:01:17 alexandre_tb |
* suppression de vieux code commenté. |
* |
* Revision 1.49 2007-10-24 13:26:02 alexandre_tb |
* bug : double saisie d url |
* |
* Revision 1.48 2007-10-17 08:24:59 alexandre_tb |
* correction multilinguisme |
* |
* Revision 1.47 2007-10-01 12:13:53 alexandre_tb |
* bug, affichage vue / action pour la vue "administrer" |
* |
* Revision 1.46 2007-09-28 14:29:13 jp_milcent |
* Ajout de la gestion de l'affichage des vues ou pas. |
* |
* Revision 1.45 2007-09-18 14:24:01 alexandre_tb |
* onglet administrer |
* |
* Revision 1.44 2007-09-06 15:39:28 alexandre_tb |
* fixation d une valeur par defaut a la variable vue pour |
* eviter un ecran vide si pas de parametres dans le menu |
* |
* Revision 1.43 2007-08-27 12:26:04 alexandre_tb |
* Mise en place de l action BAZ_VOIR_ADMIN |
* |
* Revision 1.42 2007-07-05 08:29:24 alexandre_tb |
* modification du charset iso-8859-1 vers utf8 lors l'envoie des entetes xml. |
* |
* Revision 1.41 2007-07-04 10:05:12 alexandre_tb |
* ajout d une variable $_GET['vue'] en complement de la variable action. |
* Elle correspond aux 6 vues du bazar (consulter, mes fiches, s'abonner, saisir, administrer, gestion des droits) |
* |
* Revision 1.40 2007/04/11 08:30:12 neiluj |
* remise en état du CVS... |
* |
* Revision 1.35.2.2 2007/03/07 16:53:17 jp_milcent |
* Suppression du query string "action" et non pas "nature" |
* |
* Revision 1.35.2.1 2007/02/15 13:42:16 jp_milcent |
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches. |
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature. |
* |
* Revision 1.35 2006/10/05 08:53:50 florian |
* amelioration moteur de recherche, correction de bugs |
* |
* Revision 1.34 2006/09/04 15:25:12 alexandre_tb |
* ajout d'un id dans la balise HTML du titre |
* |
* Revision 1.33 2006/06/21 15:41:42 alexandre_tb |
* rétablissement du menu mes fiches |
* |
* Revision 1.32 2006/06/21 15:40:15 alexandre_tb |
* rétablissement du menu mes fiches |
* |
* Revision 1.31 2006/05/19 13:54:32 florian |
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee |
* |
* Revision 1.30 2006/04/28 12:46:14 florian |
* integration des liens vers annuaire |
* |
* Revision 1.29 2006/04/24 10:16:22 alexandre_tb |
* ajout de la globale filtre. |
* elle remplace (à terme) catégorie nature |
* |
* Revision 1.28 2006/03/29 13:05:41 alexandre_tb |
* utilisation de la classe Administrateur_bazar |
* |
* Revision 1.27 2006/02/07 11:08:36 alexandre_tb |
* utilisation de la classe Utilisateur_bazar pour la vérification des droits |
* |
* Revision 1.26 2006/02/06 09:33:53 alexandre_tb |
* modification de l'affichage lors de la saisie de fiche |
* |
* Revision 1.25 2006/01/30 17:25:38 alexandre_tb |
* correction de bugs |
* |
* Revision 1.24 2006/01/26 11:06:43 alexandre_tb |
* ajout d'une requete pour recupere l'id_nature si un id_fiche est passé dans l'url |
* |
* Revision 1.23 2006/01/17 10:07:36 alexandre_tb |
* en cours |
* |
* Revision 1.22 2006/01/16 15:11:28 alexandre_tb |
* simplification code |
* |
* Revision 1.21 2006/01/13 14:12:52 florian |
* utilisation des temlates dans la table bazar_nature |
* |
* Revision 1.20 2006/01/05 16:28:25 alexandre_tb |
* prise en chage des checkbox, reste la mise à jour à gérer |
* |
* Revision 1.19 2006/01/03 10:19:31 florian |
* Mise à jour pour accepter des parametres dans papyrus: faire apparaitre ou non le menu, afficher qu'un type de fiches, définir l'action par défaut... |
* |
* Revision 1.18 2005/12/02 10:57:03 florian |
* MAJ pour paramétrage dans gestion de menus papyrus |
* |
* Revision 1.17 2005/12/01 16:05:41 florian |
* changement des chemins pour appli Pear |
* |
* Revision 1.16 2005/12/01 15:31:30 florian |
* correction bug modifs et saisies |
* |
* Revision 1.15 2005/11/30 13:58:45 florian |
* ajouts graphisme (logos, boutons), changement structure SQL bazar_fiche |
* |
* Revision 1.14 2005/11/24 16:17:13 florian |
* corrections bugs, ajout des cases à cocher |
* |
* Revision 1.13 2005/11/14 16:04:54 florian |
* maj bug affichage flux |
* |
* Revision 1.12 2005/11/07 17:05:46 florian |
* amélioration validation conditions de saisie, ajout des règles spécifiques de saisie des formulaires |
* |
* Revision 1.11 2005/10/21 16:15:04 florian |
* mise a jour appropriation |
* |
* Revision 1.10 2005/10/12 17:20:33 ddelon |
* Reorganisation calendrier + applette |
* |
* Revision 1.9 2005/10/12 13:35:07 florian |
* amélioration de l'interface de bazar, de manière a simplifier les consultations, et à harmoniser par rapport aux Ressources |
* |
* Revision 1.8 2005/09/30 13:00:05 ddelon |
* Fiche bazar generique |
* |
* Revision 1.7 2005/09/30 12:34:44 ddelon |
* petite modification pour integration bazar dans papyrus |
* |
* Revision 1.6 2005/09/30 12:22:54 florian |
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL |
* |
* Revision 1.4 2005/07/21 19:03:12 florian |
* nouveautés bazar: templates fiches, correction de bugs, ... |
* |
* Revision 1.2 2005/02/22 15:33:32 florian |
* integration dans Papyrus |
* |
* Revision 1.1.1.1 2005/02/17 18:05:11 florian |
* Import initial de Bazar |
* |
* Revision 1.1.1.1 2005/02/17 11:09:50 florian |
* Import initial |
* |
* Revision 1.1.1.1 2005/02/16 18:06:35 florian |
* import de la nouvelle version |
* |
* Revision 1.3 2004/07/05 15:10:14 florian |
* changement interface de saisie |
* |
* Revision 1.2 2004/07/01 10:13:41 florian |
* modif Florian |
* |
* Revision 1.1 2004/06/23 09:58:32 alex |
* version initiale |
* |
* Revision 1.1 2004/06/18 09:00:07 alex |
* version initiale |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/tags/v3.1-blanche-neige/jrest/.htaccess |
---|
New file |
0,0 → 1,4 |
RewriteEngine On |
RewriteCond %{REQUEST_FILENAME} !-d |
RewriteCond %{REQUEST_FILENAME} !-f |
RewriteRule ^.*$ /bazar_bp/jrest/index.php/ |
/tags/v3.1-blanche-neige/jrest/JRest.php |
---|
New file |
0,0 → 1,302 |
<?php |
// In : utf8 url_encoded (get et post) |
// Out : utf8 |
// TODO : gerer les retours : dans ce controleur : code retour et envoi ... |
class JRest { |
/** Parsed configuration file */ |
private $config; |
/** The HTTP request method used. */ |
private $method = 'GET'; |
/** The HTTP request data sent (if any). */ |
private $requestData = NULL; |
/** Array of strings to convert into the HTTP response. */ |
private $output = array(); |
/** Nom resource. */ |
private $resource = NULL; |
/** Identifiant unique resource. */ |
private $uid = NULL; |
/** |
* Constructor. Parses the configuration file "JRest.ini", grabs any request data sent, records the HTTP |
* request method used and parses the request URL to find out the requested resource |
* @param str iniFile Configuration file to use |
*/ |
public function JRest($iniFile = 'jrest.ini.php') { |
$this->config = parse_ini_file($iniFile, TRUE); |
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && isset($_SERVER['QUERY_STRING'])) { |
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 0) { |
$this->requestData = ''; |
$httpContent = fopen('php://input', 'r'); |
while ($data = fread($httpContent, 1024)) { |
$this->requestData .= $data; |
} |
fclose($httpContent); |
} |
if (strlen($_SERVER['QUERY_STRING']) == 0) { |
$len = strlen($_SERVER['REQUEST_URI']); |
} else { |
$len = -(strlen($_SERVER['QUERY_STRING']) + 1); |
} |
$urlString = substr($_SERVER['REQUEST_URI'], strlen($this->config['settings']['baseURL']), $len); |
$urlParts = explode('/', $urlString); |
if (isset($urlParts[0])) $this->resource = $urlParts[0]; |
if (count($urlParts) > 1 && $urlParts[1] != '') { |
array_shift($urlParts); |
foreach ($urlParts as $uid) { |
if ($uid != '') { |
$this->uid[] = urldecode($uid); |
} |
} |
} |
$this->method = $_SERVER['REQUEST_METHOD']; |
} else { |
trigger_error('I require the server variables REQUEST_URI, REQUEST_METHOD and QUERY_STRING to work.', E_USER_ERROR); |
} |
} |
/** |
* Execute the request. |
*/ |
function exec() { |
switch ($this->method) { |
case 'GET': |
$this->get(); |
break; |
case 'POST': |
$this->post(); |
break; |
case 'DELETE': |
$this->delete(); |
break; |
case 'PUT': |
$this->add(); |
break; |
} |
} |
/** |
* Execute a GET request. A GET request fetches a list of resource when no resource name is given, a list of element |
* when a resource name is given, or a resource element when a resource and resource unique identifier are given. It does not change the |
* database contents. |
*/ |
private function get() { |
if ($this->resource) { |
$resource_file = 'services/'.ucfirst($this->resource).'.php'; |
$resource_class = ucfirst($this->resource); |
if (file_exists($resource_file)) { |
include_once $resource_file; |
if (class_exists($resource_class)) { |
$service = new $resource_class($this->config); |
if ($this->uid) { // get a resource element |
if (method_exists($service, 'getElement')) { |
$service->getElement($this->uid); |
} |
} elseif (method_exists($service, 'getRessource')) { // get all elements of a ressource |
$service->getRessource(); |
} |
} |
} |
} else { // get resources |
// include set.jrest.php, instanticiation et appel |
} |
} |
private function post() { |
$pairs = array(); |
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST) |
if ($this->requestData) { |
$pairs = $this->parseRequestData(); |
} |
// Ajout des informations concernant l'upload de fichier passées dans la variable $_FILE |
if(isset($_FILES)) { |
foreach ($_FILES as $v) { |
$pairs[$v['name']] = $v; |
} |
// Ne pas effacer cette ligne ! Elle est indispensable pour les services du Carnet en ligne |
// qui n'utilisent que le tableau pairs dans les posts |
$pairs = array_merge($pairs, $_POST); |
} |
// gestion du contenu du post |
if(isset($_POST)) |
{ |
// Safari ne sait pas envoyer des DELETE avec gwt... |
// Nous utilisons le parametre "action" passé dans le POST qui doit contenir DELETE pour lancer la supression |
if ($pairs['action'] == 'DELETE') { |
$this->delete(); |
return; |
} |
if (count($pairs) != 0) { |
if ($this->uid) { // get a resource element |
$resource_file = 'services/'.ucfirst($this->resource).'.php'; |
$resource_class = ucfirst($this->resource); |
if (file_exists($resource_file)) { |
include_once $resource_file; |
if (class_exists($resource_class)) { |
$service = new $resource_class($this->config); |
if (method_exists($service,'updateElement')) { // Update element |
// TODO : a voir le retour ... |
if ($service->updateElement($this->uid, $pairs)) { |
$this->created(); |
} |
} |
} |
} |
} else { // get all elements of a ressource |
$this->add($pairs); |
} |
} else { |
$this->lengthRequired(); |
} |
} |
} |
private function delete() { |
$resource_file = 'services/'.ucfirst($this->resource).'.php'; |
$resource_class = ucfirst($this->resource); |
if (file_exists($resource_file)) { |
include_once $resource_file; |
if (class_exists($resource_class)) { |
$service = new $resource_class($this->config); |
if ($this->uid) { // get a resource element |
if (method_exists($service, 'deleteElement')) { // Delete element |
if ($service->deleteElement($this->uid)) { |
$this->noContent(); |
} |
} |
} |
} |
} |
} |
private function add($pairs = null) { |
if (is_null($pairs)) { |
$pairs = array(); |
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST) |
// FIXME : vérifier que l'on récupère bien les données passées par PUT |
if ($this->requestData) { |
$pairs = $this->parseRequestData(); |
} |
} |
if (count($pairs) != 0) { |
$resource_file = 'services/'.ucfirst($this->resource).'.php'; |
$resource_class = ucfirst($this->resource); |
if (file_exists($resource_file)) { |
include_once $resource_file; |
if (class_exists($resource_class)) { |
$service = new $resource_class($this->config); |
if (method_exists($service,'createElement')) { // Create a new element |
if ($service->createElement($pairs)) { |
$this->created(); |
} |
} |
} |
} |
} else { |
$this->lengthRequired(); |
} |
} |
/** |
* Parse the HTTP request data. |
* @return str[] Array of name value pairs |
*/ |
private function parseRequestData() { |
$values = array(); |
$pairs = explode('&', $this->requestData); |
foreach ($pairs as $pair) { |
$parts = explode('=', $pair); |
if (isset($parts[0]) && isset($parts[1])) { |
$parts[1] = rtrim(urldecode($parts[1])); |
$values[$parts[0]] = $parts[1]; |
} |
} |
return $values; |
} |
/** |
* Send a HTTP 201 response header. |
*/ |
private function created($url = FALSE) { |
header('HTTP/1.0 201 Created'); |
if ($url) { |
header('Location: '.$url); |
} |
} |
/** |
* Send a HTTP 204 response header. |
*/ |
private function noContent() { |
header('HTTP/1.0 204 No Content'); |
} |
/** |
* Send a HTTP 400 response header. |
*/ |
private function badRequest() { |
header('HTTP/1.0 400 Bad Request'); |
} |
/** |
* Send a HTTP 401 response header. |
*/ |
private function unauthorized($realm = 'JRest') { |
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { |
header('WWW-Authenticate: Basic realm="'.$realm.'"'); |
} |
header('HTTP/1.0 401 Unauthorized'); |
} |
/** |
* Send a HTTP 404 response header. |
*/ |
private function notFound() { |
header('HTTP/1.0 404 Not Found'); |
} |
/** |
* Send a HTTP 405 response header. |
*/ |
private function methodNotAllowed($allowed = 'GET, HEAD') { |
header('HTTP/1.0 405 Method Not Allowed'); |
header('Allow: '.$allowed); |
} |
/** |
* Send a HTTP 406 response header. |
*/ |
private function notAcceptable() { |
header('HTTP/1.0 406 Not Acceptable'); |
echo join(', ', array_keys($this->config['renderers'])); |
} |
/** |
* Send a HTTP 411 response header. |
*/ |
private function lengthRequired() { |
header('HTTP/1.0 411 Length Required'); |
} |
/** |
* Send a HTTP 500 response header. |
*/ |
private function internalServerError() { |
header('HTTP/1.0 500 Internal Server Error'); |
} |
} |
?> |
/tags/v3.1-blanche-neige/jrest/index.php |
---|
New file |
0,0 → 1,38 |
<?php |
// Decommenter ces lignes si version de php < 5 |
//require_once 'lib/JSON.php'; |
// Lazy require |
// TODO : voir si on ne peut pas dépacer ces inclusions directement dans les services. |
//require_once 'lib/DBAccessor.php'; |
//require_once 'lib/SpreadsheetProductor.php'; |
//require_once 'lib/PDFProductor.php'; |
//require 'JRest.php'; |
/** |
* La fonction __autoload() charge dynamiquement les classes trouvées dans le code. |
* |
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code. |
* |
*@param string le nom de la classe appelée. |
*@return void le fichier contenant la classe doit être inclu par la fonction. |
*/ |
function __autoload($classe) |
{ |
if (class_exists($classe)) { |
return null; |
} |
$chemins = array('', 'services/', 'services/include/', 'lib/'); |
foreach ($chemins as $chemin) { |
$chemin = $chemin.$classe.'.php'; |
if (file_exists($chemin)) { |
require_once $chemin; |
} |
} |
} |
$jRest =& new JRest(); |
$jRest->exec(); |
?> |
/tags/v3.1-blanche-neige/jrest/util/phpMyEditSetup.php |
---|
New file |
0,0 → 1,569 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* phpMyEditSetup.php - interactive table configuration utility (setup) |
* ____________________________________________________________ |
* |
* Copyright (c) 1999-2002 John McCreesh <jpmcc@users.sourceforge.net> |
* Copyright (c) 2001-2002 Jim Kraai <jkraai@users.sourceforge.net> |
* Versions 5.0 and higher developed by Ondrej Jombik <nepto@php.net> |
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/phpMyEditSetup.php,v 1.48 2006-09-09 07:38:54 nepto Exp $ */ |
?> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
"http://www.w3.org/TR/html4/loose.dtd"> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
<title>phpMyEdit Setup</title> |
<style type="text/css"> |
<!-- |
body { font-family: "Verdana", "Arial", "Sans-Serif"; text-align: left } |
h1 { color: #004d9c; font-size: 13pt; font-weight: bold } |
h2 { color: #004d9c; font-size: 11pt; font-weight: bold } |
h3 { color: #004d9c; font-size: 11pt; } |
p { color: #004d9c; font-size: 9pt; } |
table { border: 1px solid #004d9c; border-collapse: collapse; border-spacing: 0px; } |
td { border: 1px solid; padding: 3px; color: #004d9c; font-size: 9pt; } |
hr |
{ |
height: 1px; |
background-color: #000000; |
color: #000000; |
border: solid #000000 0; |
padding: 0; |
margin: 0; |
border-top-width: 1px; |
} |
--> |
</style> |
</head> |
<body bgcolor="white"> |
<?php |
if (! defined('PHP_EOL')) { |
define('PHP_EOL', strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? "\r\n" |
: strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n"); |
} |
$hn = @$_POST['hn']; |
$un = @$_POST['un']; |
$pw = @$_POST['pw']; |
if(strlen($_POST['db'])>0) $db = @$_POST['db']; |
if(strlen($_POST['tb'])>0) $tb = @$_POST['tb']; |
$id = @$_POST['id']; |
$submit = @$_POST['submit']; |
$options = @$_POST['options']; |
$baseFilename = @$_POST['baseFilename']; |
$pageTitle = @$_POST['pageTitle']; |
$pageHeader = @$_POST['pageHeader']; |
$HTMLissues = @$_POST['HTMLissues']; |
$CSSstylesheet = @$_POST['CSSstylesheet']; |
$phpExtension = '.php'; |
if (isset($baseFilename) && $baseFilename != '') { |
$phpFile = $baseFilename.$phpExtension; |
//$contentFile = $baseFilename.'Content.inc'; |
$contentFile = $baseFilename.'.php'; |
} elseif (isset($tb)) { |
$phpFile = $tb.$phpExtension; |
//$contentFile = $tb.'Content.inc'; |
$contentFile = $tb.'.php'; |
} else { |
$phpFile = 'index'.$phpExtension; |
//$contentFile = 'Content.inc'; |
$contentFile = 'phpMyEdit-content.php'; |
} |
$buffer = ''; |
function echo_html($x) |
{ |
echo htmlspecialchars($x),PHP_EOL; |
} |
function echo_buffer($x) |
{ |
global $buffer; |
$buffer .= $x.PHP_EOL; |
} |
#:#####################################:# |
#:# Function: check_constraints #:# |
#:# Parameters: tb=table name #:# |
#:# fd=field name #:# |
#:# return: lookup default for #:# |
#:# said constraint #:# |
#:# or null if no #:# |
#:# constraint is found. #:# |
#:# Contributed by Wade Ryan, #:# |
#:# 20060906 #:# |
#:#####################################:# |
function check_constraints($tb,$fd) |
{ |
$query = "show create table $tb"; |
$result = mysql_query($query); |
$tableDef = preg_split('/\n/',mysql_result($result,0,1)); |
$constraint_arg=""; |
while (list($key,$val) = each($tableDef)) { |
$words=preg_split("/[\s'`()]+/", $val); |
if ($words[1] == "CONSTRAINT" && $words[6]=="REFERENCES") { |
if ($words[5]==$fd) { |
$constraint_arg=" 'values' => array(\n". |
" 'table' => '$words[7]',\n". |
" 'column' => '$words[8]'\n". |
" ),\n"; |
} |
} |
} |
return $constraint_arg; |
} |
function get_versions() |
{ |
$ret_ar = array(); |
$dirname = dirname(__FILE__); |
foreach (array( |
'current' => __FILE__, |
'setup' => "$dirname/phpMyEditSetup.php", |
'core' => "$dirname/phpMyEdit.class.php", |
'version' => "$dirname/doc/VERSION") |
as $type => $file) { |
if (@file_exists($file) && @is_readable($file)) { |
if (($f = fopen($file, 'r')) == false) { |
continue; |
} |
$str = trim(fread($f, 4096)); |
if (strpos($str, ' ') === false && strlen($str) < 10) { |
$ret_ar[$type] = $str; |
} else if (preg_match('|\$'.'Platon:\s+\S+,v\s+(\d+.\d+)\s+|', $str, $matches)) { |
$ret_ar[$type] = $matches[1]; |
} |
fclose($f); |
} |
} |
return $ret_ar; |
} |
$self = basename($_SERVER['PHP_SELF']); |
$dbl = @mysql_pconnect($hn, $un, $pw); |
if ((!$dbl) or empty($submit)) { |
echo '<h1>Please log in to your MySQL database</h1>'; |
if (!empty($submit)) { |
echo '<h2>Sorry - login failed - please try again</h2>'.PHP_EOL; |
} |
if (! isset($hn)) { |
$hn = 'localhost'; |
} |
echo ' |
<form action="'.htmlspecialchars($self).'" method="POST"> |
<table border="1" cellpadding="1" cellspacing="0" summary="Login form"> |
<tr> |
<td>Hostname:</td> |
<td><input type="text" name="hn" value="'.htmlspecialchars($hn).'"></td> |
</tr><tr> |
<td>Username:</td> |
<td><input type="text" name="un" value="'.htmlspecialchars($un).'"></td> |
</tr><tr> |
<td>Password:</td> |
<td><input type="password" name="pw" value="'.htmlspecialchars($pw).'"></td> |
</tr><tr> |
<td>Database:</td> |
<td><input type="text" name="db" value="'.htmlspecialchars($db).'"></td> |
</tr><tr> |
<td>Table:</td> |
<td><input type="text" name="tb" value="'.htmlspecialchars($tb).'"></td> |
</tr> |
</table><br> |
<input type="submit" name="submit" value="Submit"> |
</form>'.PHP_EOL; |
} else if (! isset($db)) { |
$dbs = @mysql_list_dbs($dbl); |
$num_dbs = @mysql_num_rows($dbs); |
echo '<h1>Please select a database</h1> |
<form action="'.htmlspecialchars($self).'" method="POST"> |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Database selection">'.PHP_EOL; |
for ($i = 0; $i < $num_dbs; $i++) { |
$db = @mysql_db_name($dbs, $i); |
$checked = ! strcasecmp($un, $db) ? ' checked' : ''; |
$db = htmlspecialchars($db); |
echo '<tr><td><input'.$checked.' type="radio" name="db" value="'.$db.'"></td><td>'.$db.'</td></tr>'.PHP_EOL; |
} |
echo '</table><br> |
<input type="submit" name="submit" value="Submit"> |
<input type="submit" name="cancel" value="Cancel"> |
</form>'.PHP_EOL; |
} else if (!isset($tb)) { |
echo '<h1>Please select a table from database: '.htmlspecialchars($db).'</h1> |
<form action="'.htmlspecialchars($self).'" method="POST"> |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Table selection">'.PHP_EOL; |
$tbs = @mysql_list_tables($db, $dbl); |
$num_tbs = @mysql_num_rows($tbs); |
for ($j = 0; $j < $num_tbs; $j++) { |
$tb = @mysql_tablename($tbs, $j); |
$tb = htmlspecialchars($tb); |
$checked = $j == 0 ? ' checked' : ''; |
echo '<tr><td><input'.$checked.' type="radio" name="tb" value="'.$tb.'"></td><td>'.$tb.'</td></tr>'.PHP_EOL; |
} |
echo '</table><br> |
<input type="submit" name="submit" value="Submit"> |
<input type="submit" name="cancel" value="Cancel"> |
</form>'.PHP_EOL; |
} else if (!isset($id)) { |
echo ' <h1>Please select an identifier from table: '.htmlspecialchars($tb).'</h1> |
<p> |
This field will be used in change, view, copy and delete operations.<br> |
The field should be numeric and must uniquely identify a record. |
</p> |
<p> |
Please note, that there were problems reported by phpMyEdit users |
regarding using MySQL reserved word as unique key name (the example for |
this is "key" name). Thus we recommend you to use another name |
of unique key. Usage of "id" or "ID" should be safe and good idea. |
</p> |
<form action="'.htmlspecialchars($self).'" method="POST"> |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Key selection">'.PHP_EOL; |
// <tr><td><input type="radio" name="id" value=""> |
// <td><i>None</i></td><td><i>No id field required</i></td></tr> |
@mysql_select_db($db); |
$tb_desc = @mysql_query("DESCRIBE $tb"); |
$fds = @mysql_list_fields($db,$tb,$dbl); |
for ($j = 0; ($fd = @mysql_field_name($fds, $j)) != false; $j++) { |
$ff = @mysql_field_flags($fds, $j); |
strlen($ff) <= 0 && $ff = '---'; |
$checked = stristr($ff, 'primary_key') ? ' checked' : ''; |
echo '<tr><td><input',$checked,' type="radio" name="id" value="',htmlspecialchars($fd),'"></td>'; |
echo '<td>',htmlspecialchars($fd),'</td>'; |
echo '<td>',htmlspecialchars($ff),'</td>'; |
$r = @mysql_fetch_array($tb_desc, $j); |
} |
echo '</table><br> |
<input type="submit" name="submit" value="Submit"> |
<input type="submit" name="cancel" value="Cancel"> |
</form>'.PHP_EOL; |
} else if (!isset($options)) { |
echo '<h1>Please select additional options</h1> |
<form action="'.htmlspecialchars($self).'" method="POST"> |
<input type="hidden" name="hn" value="'.htmlspecialchars($hn).'"> |
<input type="hidden" name="un" value="'.htmlspecialchars($un).'"> |
<input type="hidden" name="pw" value="'.htmlspecialchars($pw).'"> |
<input type="hidden" name="db" value="'.htmlspecialchars($db).'"> |
<input type="hidden" name="tb" value="'.htmlspecialchars($tb).'"> |
<input type="hidden" name="id" value="'.htmlspecialchars($id).'"> |
<table border="1" cellpadding="1" cellspacing="1" summary="Additional options"> |
<tr><td>Base filename</td><td><input type="text" name=baseFilename value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Page title</td><td><input type="text" name=pageTitle value ="'.htmlspecialchars($tb).'"></td></tr> |
<tr><td>Page header</td><td><input type="checkbox" name=pageHeader></td></tr> |
<tr><td>HTML header & footer</td><td><input type="checkbox" name=HTMLissues></td></tr> |
<tr><td>CSS basic stylesheet</td><td><input checked type="checkbox" name=CSSstylesheet></td></tr> |
</table><br> |
<input type="submit" name="submit" value="Submit"> |
<input type="submit" name="cancel" value="Cancel"> |
<input type="hidden" name="options" value="1"> |
</form>'.PHP_EOL; |
} else { |
echo '<h1>Here is your phpMyEdit calling program</h1>'.PHP_EOL; |
echo '<h2>You may now copy and paste it into your PHP editor</h2>'.PHP_EOL; |
if ($pageHeader) { |
echo_buffer('<h3>'.$pageTitle.'</h3>'); |
} |
$versions = ''; |
$versions_ar = get_versions(); |
foreach (array( |
'version' => 'phpMyEdit version:', |
'core' => 'phpMyEdit.class.php core class:', |
'setup' => 'phpMyEditSetup.php script:', |
'current' => 'generating setup script:') |
as $type => $desc) { |
$version = isset($versions_ar[$type]) ? $versions_ar[$type] : 'unknown'; |
$versions .= sprintf("\n * %36s %s", $desc, $version); |
} |
echo_buffer("<?php |
/* |
* IMPORTANT NOTE: This generated file contains only a subset of huge amount |
* of options that can be used with phpMyEdit. To get information about all |
* features offered by phpMyEdit, check official documentation. It is available |
* online and also for download on phpMyEdit project management page: |
* |
* http://platon.sk/projects/main_page.php?project_id=5 |
* |
* This file was generated by: |
*$versions |
*/ |
// MySQL host name, user name, password, database, and table |
\$opts['hn'] = '$hn'; |
\$opts['un'] = '$un'; |
\$opts['pw'] = '$pw'; |
\$opts['db'] = '$db'; |
\$opts['tb'] = '$tb'; |
// Name of field which is the unique key |
\$opts['key'] = '$id'; |
// Type of key field (int/real/string/date etc.)"); |
if ($id == '') { |
echo_buffer("\$opts['key_type'] = '';"); |
} else { |
$fds = @mysql_list_fields($db,$tb,$dbl); |
for ($j = 0; ($fd = @mysql_field_name($fds, $j)) != ''; $j++) { |
if ($fd == $id) { |
echo_buffer("\$opts['key_type'] = '".@mysql_field_type($fds, $j)."';"); |
break; |
} |
} |
} |
echo_buffer(" |
// Sorting field(s) |
\$opts['sort_field'] = array('$id'); |
// Number of records to display on the screen |
// Value of -1 lists all records in a table |
\$opts['inc'] = 15; |
// Options you wish to give the users |
// A - add, C - change, P - copy, V - view, D - delete, |
// F - filter, I - initial sort suppressed |
\$opts['options'] = 'ACPVDF'; |
// Number of lines to display on multiple selection filters |
\$opts['multiple'] = '4'; |
// Navigation style: B - buttons (default), T - text links, G - graphic links |
// Buttons position: U - up, D - down (default) |
\$opts['navigation'] = 'DB'; |
// Display special page elements |
\$opts['display'] = array( |
'form' => true, |
'query' => true, |
'sort' => true, |
'time' => true, |
'tabs' => true |
); |
// Set default prefixes for variables |
\$opts['js']['prefix'] = 'PME_js_'; |
\$opts['dhtml']['prefix'] = 'PME_dhtml_'; |
\$opts['cgi']['prefix']['operation'] = 'PME_op_'; |
\$opts['cgi']['prefix']['sys'] = 'PME_sys_'; |
\$opts['cgi']['prefix']['data'] = 'PME_data_'; |
/* Get the user's default language and use it if possible or you can |
specify particular one you want to use. Refer to official documentation |
for list of available languages. */ |
\$opts['language'] = \$_SERVER['HTTP_ACCEPT_LANGUAGE']; |
/* Table-level filter capability. If set, it is included in the WHERE clause |
of any generated SELECT statement in SQL query. This gives you ability to |
work only with subset of data from table. |
\$opts['filters'] = \"column1 like '%11%' AND column2<17\"; |
\$opts['filters'] = \"section_id = 9\"; |
\$opts['filters'] = \"PMEtable0.sessions_count > 200\"; |
*/ |
/* Field definitions |
Fields will be displayed left to right on the screen in the order in which they |
appear in generated list. Here are some most used field options documented. |
['name'] is the title used for column headings, etc.; |
['maxlen'] maximum length to display add/edit/search input boxes |
['trimlen'] maximum length of string content to display in row listing |
['width'] is an optional display width specification for the column |
e.g. ['width'] = '100px'; |
['mask'] a string that is used by sprintf() to format field output |
['sort'] true or false; means the users may sort the display on this column |
['strip_tags'] true or false; whether to strip tags from content |
['nowrap'] true or false; whether this field should get a NOWRAP |
['select'] T - text, N - numeric, D - drop-down, M - multiple selection |
['options'] optional parameter to control whether a field is displayed |
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view |
Another flags are: |
R - indicates that a field is read only |
W - indicates that a field is a password field |
H - indicates that a field is to be hidden and marked as hidden |
['URL'] is used to make a field 'clickable' in the display |
e.g.: 'mailto:\$value', 'http://\$value' or '\$page?stuff'; |
['URLtarget'] HTML target link specification (for example: _blank) |
['textarea']['rows'] and/or ['textarea']['cols'] |
specifies a textarea is to be used to give multi-line input |
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10 |
['values'] restricts user input to the specified constants, |
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99) |
['values']['table'] and ['values']['column'] restricts user input |
to the values found in the specified column of another table |
['values']['description'] = 'desc_column' |
The optional ['values']['description'] field allows the value(s) displayed |
to the user to be different to those in the ['values']['column'] field. |
This is useful for giving more meaning to column values. Multiple |
descriptions fields are also possible. Check documentation for this. |
*/ |
"); |
@mysql_select_db($db); |
$tb_desc = @mysql_query("DESCRIBE $tb"); |
$fds = @mysql_list_fields($db, $tb, $dbl); |
$num_fds = @mysql_num_fields($fds); |
$ts_cnt = 0; |
for ($k = 0; $k < $num_fds; $k++) { |
$fd = mysql_field_name($fds,$k); |
$fm = mysql_fetch_field($fds,$k); |
$fn = strtr($fd, '_-.', ' '); |
$fn = preg_replace('/(^| +)id( +|$)/', '\\1ID\\2', $fn); // uppercase IDs |
$fn = ucfirst($fn); |
$row = @mysql_fetch_array($tb_desc); |
echo_buffer('$opts[\'fdd\'][\''.$fd.'\'] = array('); // ) |
echo_buffer(" 'name' => '".str_replace('\'','\\\'',$fn)."',"); |
$auto_increment = strstr($row[5], 'auto_increment') ? 1 : 0; |
if (substr($row[1],0,3) == 'set') { |
echo_buffer(" 'select' => 'M',"); |
} else { |
echo_buffer(" 'select' => 'T',"); |
} |
if ($auto_increment) { |
echo_buffer(" 'options' => 'AVCPDR', // auto increment"); |
} |
// timestamps are read-only |
else if (@mysql_field_type($fds, $k) == 'timestamp') { |
if ($ts_cnt > 0) { |
echo_buffer(" 'options' => 'AVCPD',"); |
} else { // first timestamp |
echo_buffer(" 'options' => 'AVCPDR', // updated automatically (MySQL feature)"); |
} |
$ts_cnt++; |
} |
echo_buffer(" 'maxlen' => ".@mysql_field_len($fds,$k).','); |
// blobs -> textarea |
if (@mysql_field_type($fds,$k) == 'blob') { |
echo_buffer(" 'textarea' => array("); |
echo_buffer(" 'rows' => 5,"); |
echo_buffer(" 'cols' => 50),"); |
} |
// SETs and ENUMs get special treatment |
if ((substr($row[1],0,3) == 'set' || substr($row[1],0,4) == 'enum') |
&& ! (($pos = strpos($row[1], '(')) === false)) { |
$indent = str_repeat(' ', 18); |
$outstr = substr($row[1], $pos + 2, -2); |
$outstr = explode("','", $outstr); |
$outstr = str_replace("''", "'", $outstr); |
$outstr = str_replace('"', '\\"', $outstr); |
$outstr = implode('",'.PHP_EOL.$indent.'"', $outstr); |
echo_buffer(" 'values' => array(".PHP_EOL.$indent.'"'.$outstr.'"),'); |
} |
// automatic support for Default values |
if ($row[4] != '' && $row[4] != 'NULL') { |
echo_buffer(" 'default' => '".$row[4]."',"); |
} else if ($auto_increment) { |
echo_buffer(" 'default' => '0',"); |
} |
// check for table constraints |
$outstr = check_constraints($tb, $fd); |
if ($outstr != '') { |
echo_buffer($outstr); |
} |
echo_buffer(" 'sort' => true"); |
//echo_buffer(" 'nowrap' => false,"); |
echo_buffer(');'); |
} |
echo_buffer(" |
// Now important call to phpMyEdit |
require_once 'phpMyEdit.class.php'; |
new phpMyEdit(\$opts); |
?> |
"); |
$css_directive = <<<END |
<style type="text/css"> |
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; } |
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; } |
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0, |
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1, |
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; } |
td.pme-buttons { text-align: left; } |
td.pme-message { text-align: center; } |
td.pme-stats { text-align: right; } |
</style> |
END; |
if (! $CSSstylesheet) { |
$css_directive = ''; |
} |
if ($HTMLissues) { |
$buffer = <<<END |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
"http://www.w3.org/TR/html4/loose.dtd"> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<title>$pageTitle</title> |
$css_directive |
</head> |
<body> |
$buffer |
</body> |
</html> |
END; |
} else if ($CSSstylesheet) { |
$buffer = $css_directive . $buffer; |
} |
// write the content include file |
echo 'Trying to write content file to: <b>'.'./'.$contentFile.'</b><br>'.PHP_EOL; |
$filehandle = @fopen('./'.$contentFile, 'w+'); |
if ($filehandle) { |
fwrite($filehandle, $buffer); |
flush($filehandle); |
fclose($filehandle); |
echo 'phpMyEdit content file written successfully<br>'; |
} else { |
echo 'phpMyEdit content file was NOT written due to inssufficient privileges.<br>'; |
echo 'Please copy and paste content listed below to <i>'.'./'.$contentFile.'</i> file.'; |
} |
echo '<br><hr>'; |
echo '<pre>'; |
echo_html($buffer); |
echo '</pre><hr>'.PHP_EOL; |
} |
?> |
</body> |
</html> |
/tags/v3.1-blanche-neige/jrest/util/phpMyEdit.class.php |
---|
New file |
0,0 → 1,3312 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* phpMyEdit.class.php - main table editor class definition file |
* ____________________________________________________________ |
* |
* Copyright (c) 1999-2002 John McCreesh <jpmcc@users.sourceforge.net> |
* Copyright (c) 2001-2002 Jim Kraai <jkraai@users.sourceforge.net> |
* Versions 5.0 and higher developed by Ondrej Jombik <nepto@php.net> |
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.188 2006-09-08 16:30:31 michal Exp $ */ |
/* This is a generic table editing program. The table and fields to be |
edited are defined in the calling program. |
This program works in three passes. |
* Pass 1 (the last part of the program) displays the selected MySQL |
table in a scrolling table on the screen. Radio buttons are used to |
select a record for editing or deletion. If the user chooses Add, |
Change, Copy, View or Delete buttons. |
* Pass 2 starts, displaying the selected record. If the user chooses |
the Save button from this screen. |
* Pass 3 processes the update and the display returns to the |
original table view (Pass 1). |
*/ |
class phpMyEdit_timer /* {{{ */ |
{ |
var $startTime; |
var $started; |
function phpMyEdit_timer($start = true) |
{ |
$this->started = false; |
if ($start) { |
$this->start(); |
} |
} |
function start() |
{ |
$startMtime = explode(' ', microtime()); |
$this->startTime = (double) $startMtime[0] + (double) $startMtime[1]; |
$this->started = true; |
} |
function end($iterations = 1) |
{ |
// get the time, check whether the timer was started later |
$endMtime = explode(' ', microtime()); |
if ($this->started) { |
$endTime = (double)($endMtime[0])+(double)($endMtime[1]); |
$dur = $endTime - $this->startTime; |
$avg = 1000 * $dur / $iterations; |
$avg = round(1000 * $avg) / 1000; |
return $avg; |
} else { |
return 'phpMyEdit_timer ERROR: timer not started'; |
} |
} |
} /* }}} */ |
if (! function_exists('array_search')) { /* {{{ */ |
function array_search($needle, $haystack) |
{ |
foreach ($haystack as $key => $value) { |
if ($needle == $value) |
return $key; |
} |
return false; |
} |
} /* }}} */ |
if (! function_exists('realpath')) { /* {{{ */ |
function realpath($path) |
{ |
return $path; |
} |
} /* }}} */ |
class phpMyEdit |
{ |
// Class variables {{{ |
// Database handling |
var $hn; // hostname |
var $un; // user name |
var $pw; // password |
var $tb; // table |
var $db; // database |
var $dbp; // database with point |
var $dbh; // database handle |
var $close_dbh; // if database handle should be closed |
// Record manipulation |
var $key; // name of field which is the unique key |
var $key_num; // number of field which is the unique key |
var $key_type; // type of key field (int/real/string/date etc.) |
var $key_delim; // character used for key value quoting |
var $rec; // number of record selected for editing |
var $inc; // number of records to display |
var $fm; // first record to display |
var $fl; // is the filter row displayed (boolean) |
var $fds; // sql field names |
var $fdn; // sql field names => $k |
var $num_fds; // number of fields |
var $options; // options for users: ACDFVPI |
var $fdd; // field definitions |
var $qfn; // value of all filters used during the last pass |
var $sfn; // sort field number (- = descending sort order) |
var $cur_tab; // current selected tab |
// Operation |
var $navop; // navigation buttons/operations |
var $sw; // filter display/hide/clear button |
var $operation; // operation to do: Add, Change, Delete |
var $saveadd; |
var $moreadd; |
var $canceladd; |
var $savechange; |
var $morechange; |
var $cancelchange; |
var $savecopy; |
var $cancelcopy; |
var $savedelete; |
var $canceldelete; |
var $cancelview; |
// Additional features |
var $labels; // multilingual labels |
var $cgi; // CGI variable features array |
var $js; // JS configuration array |
var $dhtml; // DHTML configuration array |
var $url; // URL array |
var $message; // informational message to print |
var $notify; // change notification e-mail adresses |
var $logtable; // name of optional logtable |
var $navigation; // navigation style |
var $tabs; // TAB names |
var $timer = null; // phpMyEdit_timer object |
// Predefined variables |
var $comp_ops = array('<'=>'<','<='=>'<=','='=>'=','>='=>'>=','>'=>'>'); |
var $sql_aggrs = array( |
'sum' => 'Total', |
'avg' => 'Average', |
'min' => 'Minimum', |
'max' => 'Maximum', |
'count' => 'Count'); |
var $page_types = array( |
'L' => 'list', |
'F' => 'filter', |
'A' => 'add', |
'V' => 'view', |
'C' => 'change', |
'P' => 'copy', |
'D' => 'delete' |
); |
var $default_buttons = array( |
'L' => array('<<','<','add','view','change','copy','delete','>','>>','goto','goto_combo'), |
'F' => array('<<','<','add','view','change','copy','delete','>','>>','goto','goto_combo'), |
'A' => array('save','more','cancel'), |
'C' => array('save','more','cancel'), |
'P' => array('save', 'cancel'), |
'D' => array('save','cancel'), |
'V' => array('change','cancel') |
); |
// }}} |
/* |
* column specific functions |
*/ |
function col_has_sql($k) { return isset($this->fdd[$k]['sql']); } |
function col_has_sqlw($k) { return isset($this->fdd[$k]['sqlw']) && !$this->virtual($k); } |
function col_has_values($k) { return isset($this->fdd[$k]['values']) || isset($this->fdd[$k]['values2']); } |
function col_has_php($k) { return isset($this->fdd[$k]['php']); } |
function col_has_URL($k) { return isset($this->fdd[$k]['URL']) |
|| isset($this->fdd[$k]['URLprefix']) || isset($this->fdd[$k]['URLpostfix']); } |
function col_has_multiple($k) |
{ return $this->col_has_multiple_select($k) || $this->col_has_checkboxes($k); } |
function col_has_multiple_select($k) |
{ return $this->fdd[$k]['select'] == 'M' && ! $this->fdd[$k]['values']['table']; } |
function col_has_checkboxes($k) |
{ return $this->fdd[$k]['select'] == 'C' && ! $this->fdd[$k]['values']['table']; } |
function col_has_radio_buttons($k) |
{ return $this->fdd[$k]['select'] == 'O' && ! $this->fdd[$k]['values']['table']; } |
function col_has_datemask($k) |
{ return isset($this->fdd[$k]['datemask']) || isset($this->fdd[$k]['strftimemask']); } |
/* |
* functions for indicating whether navigation style is enabled |
*/ |
function nav_buttons() { return stristr($this->navigation, 'B'); } |
function nav_text_links() { return stristr($this->navigation, 'T'); } |
function nav_graphic_links() { return stristr($this->navigation, 'G'); } |
function nav_up() { return (stristr($this->navigation, 'U') && !($this->buttons[$this->page_type]['up'] === false)); } |
function nav_down() { return (stristr($this->navigation, 'D') && !($this->buttons[$this->page_type]['down'] === false)); } |
/* |
* functions for indicating whether operations are enabled |
*/ |
function add_enabled() { return stristr($this->options, 'A'); } |
function change_enabled() { return stristr($this->options, 'C'); } |
function delete_enabled() { return stristr($this->options, 'D'); } |
function filter_enabled() { return stristr($this->options, 'F'); } |
function view_enabled() { return stristr($this->options, 'V'); } |
function copy_enabled() { return stristr($this->options, 'P') && $this->add_enabled(); } |
function tabs_enabled() { return $this->display['tabs'] && count($this->tabs) > 0; } |
function hidden($k) { return stristr($this->fdd[$k]['input'],'H'); } |
function password($k) { return stristr($this->fdd[$k]['input'],'W'); } |
function readonly($k) { return stristr($this->fdd[$k]['input'],'R') || $this->virtual($k); } |
function virtual($k) { return stristr($this->fdd[$k]['input'],'V') && $this->col_has_sql($k); } |
function add_operation() { return $this->operation == $this->labels['Add'] && $this->add_enabled(); } |
function change_operation() { return $this->operation == $this->labels['Change'] && $this->change_enabled(); } |
function copy_operation() { return $this->operation == $this->labels['Copy'] && $this->copy_enabled(); } |
function delete_operation() { return $this->operation == $this->labels['Delete'] && $this->delete_enabled(); } |
function view_operation() { return $this->operation == $this->labels['View'] && $this->view_enabled(); } |
function filter_operation() { return $this->fl && $this->filter_enabled() && $this->list_operation(); } |
function list_operation() { /* covers also filtering page */ return ! $this->change_operation() |
&& ! $this->add_operation() && ! $this->copy_operation() |
&& ! $this->delete_operation() && ! $this->view_operation(); } |
function next_operation() { return ($this->navop == $this->labels['Next']) || ($this->navop == '>'); } |
function prev_operation() { return ($this->navop == $this->labels['Prev']) || ($this->navop == '<'); } |
function first_operation() { return ($this->navop == $this->labels['First']) || ($this->navop == '<<'); } |
function last_operation() { return ($this->navop == $this->labels['Last']) || ($this->navop == '>>'); } |
function clear_operation() { return $this->sw == $this->labels['Clear']; } |
function add_canceled() { return $this->canceladd == $this->labels['Cancel']; } |
function view_canceled() { return $this->cancelview == $this->labels['Cancel']; } |
function change_canceled() { return $this->cancelchange == $this->labels['Cancel']; } |
function copy_canceled() { return $this->cancelcopy == $this->labels['Cancel']; } |
function delete_canceled() { return $this->canceldelete == $this->labels['Cancel']; } |
function is_values2($k, $val = 'X') /* {{{ */ |
{ |
return $val === null || |
(isset($this->fdd[$k]['values2']) && !isset($this->fdd[$k]['values']['table'])); |
} /* }}} */ |
function processed($k) /* {{{ */ |
{ |
if ($this->virtual($k)) { |
return false; |
} |
$options = @$this->fdd[$k]['options']; |
if (! isset($options)) { |
return true; |
} |
return |
($this->saveadd == $this->labels['Save'] && stristr($options, 'A')) || |
($this->moreadd == $this->labels['More'] && stristr($options, 'A')) || |
($this->savechange == $this->labels['Save'] && stristr($options, 'C')) || |
($this->morechange == $this->labels['Apply'] && stristr($options, 'C')) || |
($this->savecopy == $this->labels['Save'] && stristr($options, 'P')) || |
($this->savedelete == $this->labels['Save'] && stristr($options, 'D')); |
} /* }}} */ |
function displayed($k) /* {{{ */ |
{ |
if (is_numeric($k)) { |
$k = $this->fds[$k]; |
} |
$options = @$this->fdd[$k]['options']; |
if (! isset($options)) { |
return true; |
} |
return |
($this->add_operation() && stristr($options, 'A')) || |
($this->view_operation() && stristr($options, 'V')) || |
($this->change_operation() && stristr($options, 'C')) || |
($this->copy_operation() && stristr($options, 'P')) || |
($this->delete_operation() && stristr($options, 'D')) || |
($this->filter_operation() && stristr($options, 'F')) || |
($this->list_operation() && stristr($options, 'L')); |
} /* }}} */ |
function debug_var($name, $val) /* {{{ */ |
{ |
if (is_array($val) || is_object($val)) { |
echo "<pre>$name\n"; |
ob_start(); |
//print_r($val); |
var_dump($val); |
$content = ob_get_contents(); |
ob_end_clean(); |
echo htmlspecialchars($content); |
echo "</pre>\n"; |
} else { |
echo 'debug_var()::<i>',htmlspecialchars($name),'</i>'; |
echo '::<b>',htmlspecialchars($val),'</b>::',"<br />\n"; |
} |
} /* }}} */ |
function myquery($qry, $line = 0, $debug = 0) /* {{{ */ |
{ |
global $debug_query; |
if ($debug_query || $debug) { |
$line = intval($line); |
echo '<h4>MySQL query at line ',$line,'</h4>',htmlspecialchars($qry),'<hr />',"\n"; |
} |
if (isset($this->db)) { |
$ret = @mysql_db_query($this->db, $qry, $this->dbh); |
} else { |
$ret = @mysql_query($qry, $this->dbh); |
} |
if (! $ret) { |
echo '<h4>MySQL error ',mysql_errno($this->dbh),'</h4>'; |
echo htmlspecialchars(mysql_error($this->dbh)),'<hr />',"\n"; |
} |
return $ret; |
} /* }}} */ |
function make_language_labels($language) /* {{{ */ |
{ |
// just try the first language and variant |
// this isn't content-negotiation rfc compliant |
$language = strtoupper($language); |
// try the full language w/ variant |
$file = $this->dir['lang'].'PME.lang.'.$language.'.inc'; |
if (! file_exists($file)) { |
// try the language w/o variant |
$file = $this->dir['lang'].'PME.lang.'.substr($language,0,2).'.inc'; |
} |
if (! file_exists($file)) { |
// default to classical English |
$file = $this->dir['lang'].'PME.lang.EN.inc'; |
} |
$ret = @include($file); |
if (! is_array($ret)) { |
return $ret; |
} |
$small = array( |
'Search' => 'v', |
'Hide' => '^', |
'Clear' => 'X', |
'Query' => htmlspecialchars('>')); |
if ((!$this->nav_text_links() && !$this->nav_graphic_links()) |
|| !isset($ret['Search']) || !isset($ret['Query']) |
|| !isset($ret['Hide']) || !isset($ret['Clear'])) { |
foreach ($small as $key => $val) { |
$ret[$key] = $val; |
} |
} |
return $ret; |
} /* }}} */ |
function set_values($field_num, $prepend = null, $append = null, $strict = false) /* {{{ */ |
{ |
return (array) $prepend + (array) $this->fdd[$field_num]['values2'] |
+ (isset($this->fdd[$field_num]['values']['table']) || $strict |
? $this->set_values_from_table($field_num, $strict) |
: array()) |
+ (array) $append; |
} /* }}} */ |
function set_values_from_table($field_num, $strict = false) /* {{{ */ |
{ |
$db = &$this->fdd[$field_num]['values']['db']; |
$table = &$this->fdd[$field_num]['values']['table']; |
$key = &$this->fdd[$field_num]['values']['column']; |
$desc = &$this->fdd[$field_num]['values']['description']; |
$dbp = isset($db) ? "$db." : $this->dbp; |
$qparts['type'] = 'select'; |
if ($table) { |
$qparts['select'] = 'DISTINCT '.$table.'.'.$key; |
if ($desc && is_array($desc) && is_array($desc['columns'])) { |
$qparts['select'] .= ',CONCAT('; // ) |
$num_cols = sizeof($desc['columns']); |
if (isset($desc['divs'][-1])) { |
$qparts['select'] .= '"'.addslashes($desc['divs'][-1]).'",'; |
} |
foreach ($desc['columns'] as $key => $val) { |
if ($val) { |
$qparts['select'] .= 'IFNULL('.$val.',"")'; |
if ($desc['divs'][$key]) { |
$qparts['select'] .= ',"'.addslashes($desc['divs'][$key]).'"'; |
} |
$qparts['select'] .= ','; |
} |
} |
$qparts['select']{strlen($qparts['select']) - 1} = ')'; |
$qparts['select'] .= ' AS PMEalias'.$field_num; |
$qparts['orderby'] = 'PMEalias'.$field_num; |
} else if ($desc && is_array($desc)) { |
// TODO |
} else if ($desc) { |
$qparts['select'] .= ','.$table.'.'.$desc; |
$qparts['orderby'] = $desc; |
} else if ($key) { |
$qparts['orderby'] = $key; |
} |
$qparts['from'] = "$dbp$table"; |
$ar = array( |
'table' => $table, |
'column' => $column, |
'description' => $desc); |
$qparts['where'] = $this->substituteVars($this->fdd[$field_num]['values']['filters'], $ar); |
if ($this->fdd[$field_num]['values']['orderby']) { |
$qparts['orderby'] = $this->substituteVars($this->fdd[$field_num]['values']['orderby'], $ar); |
} |
} else { /* simple value extraction */ |
$key = &$this->fds[$field_num]; |
$this->virtual($field_num) && $key = $this->fqn($field_num); |
$qparts['select'] = 'DISTINCT '.$key.' AS PMEkey'; |
$qparts['orderby'] = 'PMEkey'; |
$qparts['from'] = $this->dbp.$this->tb; |
} |
$values = array(); |
$res = $this->myquery($this->get_SQL_query($qparts), __LINE__); |
while ($row = @mysql_fetch_array($res, MYSQL_NUM)) { |
$values[$row[0]] = $desc ? $row[1] : $row[0]; |
} |
return $values; |
} /* }}} */ |
function fqn($field, $dont_desc = false, $dont_cols = false) /* {{{ */ |
{ |
is_numeric($field) || $field = array_search($field, $this->fds); |
// if read SQL expression exists use it |
if ($this->col_has_sql($field)) |
return $this->fdd[$field]['sql']; |
// on copy/change always use simple key retrieving |
if ($this->add_operation() |
|| $this->copy_operation() |
|| $this->change_operation()) { |
$ret = 'PMEtable0.'.$this->fds[$field]; |
} else { |
if ($this->fdd[$this->fds[$field]]['values']['description'] && ! $dont_desc) { |
$desc = &$this->fdd[$this->fds[$field]]['values']['description']; |
if (is_array($desc) && is_array($desc['columns'])) { |
$ret = 'CONCAT('; // ) |
$num_cols = sizeof($desc['columns']); |
if (isset($desc['divs'][-1])) { |
$ret .= '"'.addslashes($desc['divs'][-1]).'",'; |
} |
foreach ($desc['columns'] as $key => $val) { |
if ($val) { |
$ret .= 'PMEjoin'.$field.'.'.$val; |
if ($desc['divs'][$key]) { |
$ret .= ',"'.addslashes($desc['divs'][$key]).'"'; |
} |
$ret .= ','; |
} |
} |
$ret{strlen($ret) - 1} = ')'; |
} else if (is_array($desc)) { |
// TODO |
} else { |
$ret = 'PMEjoin'.$field.'.'.$this->fdd[$this->fds[$field]]['values']['description']; |
} |
// TODO: remove me |
} elseif (0 && $this->fdd[$this->fds[$field]]['values']['column'] && ! $dont_cols) { |
$ret = 'PMEjoin'.$field.'.'.$this->fdd[$this->fds[$field]]['values']['column']; |
} else { |
$ret = 'PMEtable0.'.$this->fds[$field]; |
} |
// TODO: not neccessary, remove me! |
if (is_array($this->fdd[$this->fds[$field]]['values2'])) { |
} |
} |
return $ret; |
} /* }}} */ |
function get_SQL_query($parts) /* {{{ */ |
{ |
foreach ($parts as $k => $v) { |
$parts[$k] = trim($parts[$k]); |
} |
switch ($parts['type']) { |
case 'select': |
$ret = 'SELECT '; |
if ($parts['DISTINCT']) |
$ret .= 'DISTINCT '; |
$ret .= $parts['select']; |
$ret .= ' FROM '.$parts['from']; |
if ($parts['where'] != '') |
$ret .= ' WHERE '.$parts['where']; |
if ($parts['groupby'] != '') |
$ret .= ' GROUP BY '.$parts['groupby']; |
if ($parts['having'] != '') |
$ret .= ' HAVING '.$parts['having']; |
if ($parts['orderby'] != '') |
$ret .= ' ORDER BY '.$parts['orderby']; |
if ($parts['limit'] != '') |
$ret .= ' LIMIT '.$parts['limit']; |
if ($parts['procedure'] != '') |
$ret .= ' PROCEDURE '.$parts['procedure']; |
break; |
case 'update': |
$ret = 'UPDATE '.$parts['table']; |
$ret .= ' SET '.$parts['fields']; |
if ($parts['where'] != '') |
$ret .= ' WHERE '.$parts['where']; |
break; |
case 'insert': |
$ret = 'INSERT INTO '.$parts['table']; |
$ret .= ' VALUES '.$parts['values']; |
break; |
case 'delete': |
$ret = 'DELETE FROM '.$parts['table']; |
if ($parts['where'] != '') |
$ret .= ' WHERE '.$parts['where']; |
break; |
default: |
die('unknown query type'); |
break; |
} |
return $ret; |
} /* }}} */ |
function get_SQL_column_list() /* {{{ */ |
{ |
$fields = array(); |
for ($k = 0; $k < $this->num_fds; $k++) { |
if (! $this->displayed[$k] && $k != $this->key_num) { |
continue; |
} |
$fields[] = $this->fqn($k).' AS qf'.$k; |
if ($this->col_has_values($k)) { |
$fields[] = $this->fqn($k, true, true).' AS qf'.$k.'_idx'; |
} |
if ($this->col_has_datemask($k)) { |
$fields[] = 'UNIX_TIMESTAMP('.$this->fqn($k).') AS qf'.$k.'_timestamp'; |
} |
} |
return join(',', $fields); |
} /* }}} */ |
function get_SQL_join_clause() /* {{{ */ |
{ |
$main_table = 'PMEtable0'; |
$join_clause = $this->tb." AS $main_table"; |
for ($k = 0, $numfds = sizeof($this->fds); $k < $numfds; $k++) { |
$main_column = $this->fds[$k]; |
if($this->fdd[$main_column]['values']['db']) { |
$dbp = $this->fdd[$main_column]['values']['db'].'.'; |
} else { |
$dbp = $this->dbp; |
} |
$table = @$this->fdd[$main_column]['values']['table']; |
$join_column = @$this->fdd[$main_column]['values']['column']; |
$join_desc = @$this->fdd[$main_column]['values']['description']; |
if ($join_desc != '' && $join_column != '') { |
$join_table = 'PMEjoin'.$k; |
$ar = array( |
'main_table' => $main_table, |
'main_column' => $main_column, |
'join_table' => $join_table, |
'join_column' => $join_column, |
'join_description' => $join_desc); |
$join_clause .= " LEFT OUTER JOIN $dbp$table AS $join_table ON ("; |
$join_clause .= isset($this->fdd[$main_column]['values']['join']) |
? $this->substituteVars($this->fdd[$main_column]['values']['join'], $ar) |
: "$join_table.$join_column = $main_table.$main_column"; |
if (isset($this->fdd[$main_column]['values']['filters'])) { |
$join_clause .= ' AND '; |
$join_clause .= $this->substituteVars($this->fdd[$main_column]['values']['filters'], $ar); |
} |
$join_clause .= ')'; |
} |
} |
return $join_clause; |
} /* }}} */ |
function get_SQL_where_from_query_opts($qp = null, $text = 0) /* {{{ */ |
{ |
if ($qp == null) { |
$qp = $this->query_opts; |
} |
$where = array(); |
foreach ($qp as $field => $ov) { |
if (is_numeric($field)) { |
$tmp_where = array(); |
foreach ($ov as $field2 => $ov2) { |
$tmp_where[] = sprintf('%s %s %s', $field2, $ov2['oper'], $ov2['value']); |
} |
$where[] = '('.join(' OR ', $tmp_where).')'; |
} else { |
if (is_array($ov['value'])) { |
$tmp_ov_val = ''; |
foreach ($ov['value'] as $ov_val) { |
strlen($tmp_ov_val) > 0 && $tmp_ov_val .= ' OR '; |
$tmp_ov_val .= sprintf('FIND_IN_SET("%s",%s)', $ov_val, $field); |
} |
$where[] = "($tmp_ov_val)"; |
} else { |
$where[] = sprintf('%s %s %s', $field, $ov['oper'], $ov['value']); |
} |
} |
} |
// Add any coder specified filters |
if (! $text && $this->filters) { |
$where[] = '('.$this->filters.')'; |
} |
if (count($where) > 0) { |
if ($text) { |
return str_replace('%', '*', join(' AND ',$where)); |
} else { |
return join(' AND ',$where); |
} |
} |
return ''; /* empty string */ |
} /* }}} */ |
function gather_query_opts() /* {{{ */ |
{ |
$this->query_opts = array(); |
$this->prev_qfn = $this->qfn; |
$this->qfn = ''; |
if ($this->clear_operation()) { |
return; |
} |
// gathers query options into an array, $this->query_opts |
$qo = array(); |
for ($k = 0; $k < $this->num_fds; $k++) { |
$l = 'qf'.$k; |
$lc = 'qf'.$k.'_comp'; |
$li = 'qf'.$k.'_id'; |
$m = $this->get_sys_cgi_var($l); |
$mc = $this->get_sys_cgi_var($lc); |
$mi = $this->get_sys_cgi_var($li); |
if (! isset($m) && ! isset($mi)) { |
continue; |
} |
if (is_array($m) || is_array($mi)) { |
if (is_array($mi)) { |
$m = $mi; |
$l = $li; |
} |
if (in_array('*', $m)) { |
continue; |
} |
if ($this->col_has_values($k) && $this->col_has_multiple($k)) { |
foreach (array_keys($m) as $key) { |
$m[$key] = addslashes($m[$key]); |
} |
$qo[$this->fqn($k)] = array('value' => $m); |
} else { |
$qf_op = ''; |
foreach (array_keys($m) as $key) { |
if ($qf_op == '') { |
$qf_op = 'IN'; |
$qf_val = '"'.addslashes($m[$key]).'"'; |
$afilter = ' IN ("'.addslashes($m[$key]).'"'; // ) |
} else { |
$afilter = $afilter.',"'.addslashes($m[$key]).'"'; |
$qf_val .= ',"'.addslashes($m[$key]).'"'; |
} |
$this->qfn .= '&'.$this->cgi['prefix']['sys'].$l.'['.rawurlencode($key).']='.rawurlencode($m[$key]); |
} |
$afilter = $afilter.')'; |
// XXX: $dont_desc and $dont_cols hack |
$dont_desc = isset($this->fdd[$k]['values']['description']); |
$dont_cols = isset($this->fdd[$k]['values']['column']); |
$qo[$this->fqn($k, $dont_desc, $dont_cols)] = |
array('oper' => $qf_op, 'value' => "($qf_val)"); // ) |
} |
} else if (isset($mi)) { |
if ($mi == '*') { |
continue; |
} |
if ($this->fdd[$k]['select'] != 'M' && $this->fdd[$k]['select'] != 'D' && $mi == '') { |
continue; |
} |
$afilter = addslashes($mi); |
$qo[$this->fqn($k, true, true)] = array('oper' => '=', 'value' => "'$afilter'"); |
$this->qfn .= '&'.$this->cgi['prefix']['sys'].$li.'='.rawurlencode($mi); |
} else if (isset($m)) { |
if ($m == '*') { |
continue; |
} |
if ($this->fdd[$k]['select'] != 'M' && $this->fdd[$k]['select'] != 'D' && $m == '') { |
continue; |
} |
$afilter = addslashes($m); |
if ($this->fdd[$k]['select'] == 'N') { |
$mc = in_array($mc, $this->comp_ops) ? $mc : '='; |
$qo[$this->fqn($k)] = array('oper' => $mc, 'value' => "'$afilter'"); |
$this->qfn .= '&'.$this->cgi['prefix']['sys'].$l .'='.rawurlencode($m); |
$this->qfn .= '&'.$this->cgi['prefix']['sys'].$lc.'='.rawurlencode($mc); |
} else { |
$afilter = '%'.str_replace('*', '%', $afilter).'%'; |
$ids = array(); |
$ar = array(); |
$ar[$this->fqn($k)] = array('oper' => 'LIKE', 'value' => "'$afilter'"); |
if (is_array($this->fdd[$k]['values2'])) { |
foreach ($this->fdd[$k]['values2'] as $key => $val) { |
if (strlen($m) > 0 && stristr($val, $m)) { |
$ids[] = '"'.addslashes($key).'"'; |
} |
} |
if (count($ids) > 0) { |
$ar[$this->fqn($k, true, true)] |
= array('oper' => 'IN', 'value' => '('.join(',', $ids).')'); |
} |
} |
$qo[] = $ar; |
$this->qfn .= '&'.$this->cgi['prefix']['sys'].$l.'='.rawurlencode($m); |
} |
} |
} |
$this->query_opts = $qo; |
} /* }}} */ |
/* |
* Create JavaScripts |
*/ |
function form_begin() /* {{{ */ |
{ |
$page_name = htmlspecialchars($this->page_name); |
if ($this->add_operation() || $this->change_operation() || $this->copy_operation() |
|| $this->view_operation() || $this->delete_operation()) { |
$field_to_tab = array(); |
for ($tab = $k = $this->cur_tab = 0; $k < $this->num_fds; $k++) { |
if (isset($this->fdd[$k]['tab'])) { |
if ($tab == 0 && $k > 0) { |
$this->tabs[0] = 'PMEtab0'; |
$this->cur_tab = 1; |
$tab++; |
} |
if (is_array($this->fdd[$k]['tab'])) { |
$this->tabs[$tab] = @$this->fdd[$k]['tab']['name']; |
$this->fdd[$k]['tab']['default'] && $this->cur_tab = $tab; |
} else { |
$this->tabs[$tab] = @$this->fdd[$k]['tab']; |
} |
$tab++; |
} |
$field_to_tab[$k] = max(0, $tab - 1); |
} |
if (preg_match('/^'.$this->dhtml['prefix'].'tab(\d+)$/', $this->get_sys_cgi_var('cur_tab'), $parts)) { |
$this->cur_tab = $parts[1]; |
} |
if ($this->tabs_enabled()) { |
// initial TAB styles |
echo '<style type="text/css" media="screen">',"\n"; |
for ($i = 0; $i < count($this->tabs); $i++) { |
echo ' #'.$this->dhtml['prefix'].'tab',$i,' { display: '; |
echo (($i == $this->cur_tab || $this->tabs[$i] == 'PMEtab0' ) ? 'block' : 'none') ,'; }',"\n"; |
} |
echo '</style>',"\n"; |
// TAB javascripts |
echo '<script type="text/javascript"><!--',"\n\n"; |
$css_class_name1 = $this->getCSSclass('tab', $position); |
$css_class_name2 = $this->getCSSclass('tab-selected', $position); |
echo 'var '.$this->js['prefix'].'cur_tab = "'.$this->dhtml['prefix'].'tab',$this->cur_tab,'"; |
function '.$this->js['prefix'].'show_tab(tab_name) |
{'; |
if ($this->nav_up()) { |
echo ' |
document.getElementById('.$this->js['prefix'].'cur_tab+"_up_label").className = "',$css_class_name1,'"; |
document.getElementById('.$this->js['prefix'].'cur_tab+"_up_link").className = "',$css_class_name1,'"; |
document.getElementById(tab_name+"_up_label").className = "',$css_class_name2,'"; |
document.getElementById(tab_name+"_up_link").className = "',$css_class_name2,'";'; |
} |
if ($this->nav_down()) { |
echo ' |
document.getElementById('.$this->js['prefix'].'cur_tab+"_down_label").className = "',$css_class_name1,'"; |
document.getElementById('.$this->js['prefix'].'cur_tab+"_down_link").className = "',$css_class_name1,'"; |
document.getElementById(tab_name+"_down_label").className = "',$css_class_name2,'"; |
document.getElementById(tab_name+"_down_link").className = "',$css_class_name2,'";'; |
} |
echo ' |
document.getElementById('.$this->js['prefix'].'cur_tab).style.display = "none"; |
document.getElementById(tab_name).style.display = "block"; |
'.$this->js['prefix'].'cur_tab = tab_name; |
document.'.$this->cgi['prefix']['sys'].'form.'.$this->cgi['prefix']['sys'].'cur_tab.value = tab_name; |
}',"\n\n"; |
echo '// --></script>', "\n"; |
} |
} |
if ($this->add_operation() || $this->change_operation() || $this->copy_operation()) { |
$first_required = true; |
for ($k = 0; $k < $this->num_fds; $k++) { |
if ($this->displayed[$k] && ! $this->readonly($k) && ! $this->hidden($k) |
&& ($this->fdd[$k]['js']['required'] || isset($this->fdd[$k]['js']['regexp']))) { |
if ($first_required) { |
$first_required = false; |
echo '<script type="text/javascript"><!--',"\n"; |
echo ' |
function '.$this->js['prefix'].'trim(str) |
{ |
while (str.substring(0, 1) == " " |
|| str.substring(0, 1) == "\\n" |
|| str.substring(0, 1) == "\\r") |
{ |
str = str.substring(1, str.length); |
} |
while (str.substring(str.length - 1, str.length) == " " |
|| str.substring(str.length - 1, str.length) == "\\n" |
|| str.substring(str.length - 1, str.length) == "\\r") |
{ |
str = str.substring(0, str.length - 1); |
} |
return str; |
} |
function '.$this->js['prefix'].'form_control(theForm) |
{',"\n"; |
} |
if ($this->col_has_values($k)) { |
$condition = 'theForm.'.$this->cgi['prefix']['data'].$this->fds[$k].'.selectedIndex == -1'; |
$multiple = $this->col_has_multiple_select($k); |
} else { |
$condition = ''; |
$multiple = false; |
if ($this->fdd[$k]['js']['required']) { |
$condition = $this->js['prefix'].'trim(theForm.'.$this->cgi['prefix']['data'].$this->fds[$k].'.value) == ""'; |
} |
if (isset($this->fdd[$k]['js']['regexp'])) { |
$condition .= (strlen($condition) > 0 ? ' || ' : ''); |
$condition .= sprintf('!(%s.test('.$this->js['prefix'].'trim(theForm.%s.value)))', |
$this->fdd[$k]['js']['regexp'], $this->cgi['prefix']['data'].$this->fds[$k]); |
} |
} |
/* Multiple selects have their name like ``name[]''. |
It is not possible to work with them directly, because |
theForm.name[].something will result into JavaScript |
syntax error. Following search algorithm is provided |
as a workaround for this. |
*/ |
if ($multiple) { |
echo ' |
multiple_select = null; |
for (i = 0; i < theForm.length; i++) { |
if (theForm.elements[i].name == "',$this->cgi['prefix']['data'].$this->fds[$k],'[]") { |
multiple_select = theForm.elements[i]; |
break; |
} |
} |
if (multiple_select != null && multiple_select.selectedIndex == -1) {'; |
} else { |
echo ' |
if (',$condition,') {'; |
} |
echo ' |
alert("'; |
if (isset($this->fdd[$k]['js']['hint'])) { |
echo htmlspecialchars($this->fdd[$k]['js']['hint']); |
} else { |
echo $this->labels['Please enter'],' ',$this->fdd[$k]['name'],'.'; |
} |
echo '");'; |
if ($this->tabs_enabled() && $field_to_tab[$k] >= $this->cur_tab) { |
echo ' |
'.$this->js['prefix'].'show_tab("'.$this->dhtml['prefix'].'tab',$field_to_tab[$k],'");'; |
} |
echo ' |
theForm.',$this->cgi['prefix']['data'].$this->fds[$k],'.focus(); |
return false; |
}',"\n"; |
} |
} |
if (! $first_required) { |
echo ' |
return true; |
}',"\n\n"; |
echo '// --></script>', "\n"; |
} |
} |
if ($this->filter_operation()) { |
echo '<script type="text/javascript"><!--',"\n"; |
echo ' |
function '.$this->js['prefix'].'filter_handler(theForm, theEvent) |
{ |
var pressed_key = null; |
if (theEvent.which) { |
pressed_key = theEvent.which; |
} else { |
pressed_key = theEvent.keyCode; |
} |
if (pressed_key == 13) { // enter pressed |
theForm.submit(); |
return false; |
} |
return true; |
}',"\n\n"; |
echo '// --></script>', "\n"; |
} |
if ($this->display['form']) { |
echo '<form class="',$this->getCSSclass('form'),'" method="post"'; |
echo ' action="',$page_name,'" name="'.$this->cgi['prefix']['sys'].'form">',"\n"; |
} |
return true; |
} /* }}} */ |
function form_end() /* {{{ */ |
{ |
if ($this->display['form']) { |
echo '</form>',"\n"; |
} |
} /* }}} */ |
function display_tab_labels($position) /* {{{ */ |
{ |
if (! is_array($this->tabs)) { |
return false; |
} |
echo '<table summary="labels" class="',$this->getCSSclass('tab', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('tab', $position),'">',"\n"; |
for ($i = ($this->tabs[0] == 'PMEtab0' ? 1 : 0); $i < count($this->tabs); $i++) { |
$css_class_name = $this->getCSSclass($i != $this->cur_tab ? 'tab' : 'tab-selected', $position); |
echo '<td class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_label">'; |
echo '<a class="',$css_class_name,'" id="'.$this->dhtml['prefix'].'tab',$i,'_',$position,'_link'; |
echo '" href="javascript:'.$this->js['prefix'].'show_tab(\''.$this->dhtml['prefix'].'tab',$i,'\')">'; |
echo $this->tabs[$i],'</a></td>',"\n"; |
} |
echo '<td class="',$this->getCSSclass('tab-end', $position),'"> </td>',"\n"; |
echo '</tr>',"\n"; |
echo '</table>',"\n"; |
} /* }}} */ |
/* |
* Display functions |
*/ |
function display_add_record() /* {{{ */ |
{ |
for ($tab = 0, $k = 0; $k < $this->num_fds; $k++) { |
if (isset($this->fdd[$k]['tab']) && $this->tabs_enabled() && $k > 0) { |
$tab++; |
echo '</table>',"\n"; |
echo '</div>',"\n"; |
echo '<div id="'.$this->dhtml['prefix'].'tab',$tab,'">',"\n"; |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
} |
if (! $this->displayed[$k]) { |
continue; |
} |
if ($this->hidden($k)) { |
echo $this->htmlHiddenData($this->fds[$k], $this->fdd[$k]['default']); |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix); |
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true; |
echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">'; |
echo $this->fdd[$k]['name'],'</td>',"\n"; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$selected = @$this->fdd[$k]['default']; |
$multiple = $this->col_has_multiple($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
//$escape = true; |
if ($this->col_has_checkboxes($k) || $this->col_has_radio_buttons($k)) { |
echo $this->htmlRadioCheck($this->cgi['prefix']['data'].$this->fds[$k], |
$css_class_name, $vals, $selected, $multiple, $readonly, |
$strip_tags, $escape); |
} else { |
echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], |
$css_class_name, $vals, $selected, $multiple, $readonly, |
$strip_tags, $escape); |
} |
} elseif (isset ($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled="disabled"' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>'; |
if($escape) echo htmlspecialchars($this->fdd[$k]['default']); |
else echo $this->fdd[$k]['default']; |
echo '</textarea>',"\n"; |
} elseif ($this->col_has_php($k)) { |
echo include($this->fdd[$k]['php']); |
} else { |
// Simple edit box required |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" '; |
echo ($this->password($k) ? 'type="password"' : 'type="text"'); |
echo ($this->readonly($k) ? ' disabled="disabled"' : ''); |
echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo $size_ml_props,' value="'; |
if($escape) echo htmlspecialchars($this->fdd[$k]['default']); |
else echo $this->fdd[$k]['default']; |
echo '" />'; |
} |
echo '</td>',"\n"; |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} /* }}} */ |
function display_copy_change_delete_record() /* {{{ */ |
{ |
/* |
* For delete or change: SQL SELECT to retrieve the selected record |
*/ |
$qparts['type'] = 'select'; |
$qparts['select'] = $this->get_SQL_column_list(); |
$qparts['from'] = $this->get_SQL_join_clause(); |
$qparts['where'] = '('.$this->fqn($this->key).'=' |
.$this->key_delim.$this->rec.$this->key_delim.')'; |
$res = $this->myquery($this->get_SQL_query($qparts),__LINE__); |
if (! ($row = @mysql_fetch_array($res, MYSQL_ASSOC))) { |
return false; |
} |
for ($tab = 0, $k = 0; $k < $this->num_fds; $k++) { |
if (isset($this->fdd[$k]['tab']) && $this->tabs_enabled() && $k > 0) { |
$tab++; |
echo '</table>',"\n"; |
echo '</div>',"\n"; |
echo '<div id="'.$this->dhtml['prefix'].'tab',$tab,'">',"\n"; |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
} |
if (! $this->displayed[$k]) { |
continue; |
} |
if ($this->copy_operation() || $this->change_operation()) { |
if ($this->hidden($k)) { |
if ($k != $this->key_num) { |
echo $this->htmlHiddenData($this->fds[$k], $row["qf$k"]); |
} |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">'; |
echo $this->fdd[$k]['name'],'</td>',"\n"; |
/* There are two possibilities of readonly fields handling: |
1. Display plain text for readonly timestamps, dates and URLs. |
2. Display disabled input field |
In all cases particular readonly field will NOT be saved. */ |
if ($this->readonly($k) && ($this->col_has_datemask($k) || $this->col_has_URL($k))) { |
echo $this->display_delete_field($row, $k); |
} elseif ($this->password($k)) { |
echo $this->display_password_field($row, $k); |
} else { |
echo $this->display_change_field($row, $k); |
} |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} elseif ($this->delete_operation() || $this->view_operation()) { |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">'; |
echo $this->fdd[$k]['name'],'</td>',"\n"; |
if ($this->password($k)) { |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),'>',$this->labels['hidden'],'</td>',"\n"; |
} else { |
$this->display_delete_field($row, $k); |
} |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} |
} /* }}} */ |
function display_change_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$multiple = $this->col_has_multiple($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
//$escape = true; |
if ($this->col_has_checkboxes($k) || $this->col_has_radio_buttons($k)) { |
echo $this->htmlRadioCheck($this->cgi['prefix']['data'].$this->fds[$k], |
$css_class_name, $vals, $row["qf$k"], $multiple, $readonly, |
$strip_tags, $escape); |
} else { |
echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], |
$css_class_name, $vals, $row["qf$k"], $multiple, $readonly, |
$strip_tags, $escape); |
} |
} elseif (isset($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled="disabled"' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>'; |
if($escape) echo htmlspecialchars($row["qf$k"]); |
else echo $row["qf$k"]; |
echo '</textarea>',"\n"; |
} elseif ($this->col_has_php($k)) { |
echo include($this->fdd[$k]['php']); |
} else { |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled="disabled" ' : ''); |
echo 'name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
if($escape) echo htmlspecialchars($row["qf$k"]); |
else echo $row["qf$k"]; |
echo '" />',"\n"; |
} |
echo '</td>',"\n"; |
} /* }}} */ |
function display_password_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$this->getCSSclass('value', null, true, $css_postfix),'" type="password" '; |
echo ($this->readonly($k) ? 'disabled="disabled" ' : ''); |
echo 'name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,' />',"\n"; |
echo '</td>',"\n"; |
} /* }}} */ |
function display_delete_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('value', null, true, $css_postfix); |
echo '<td class="',$css_class_name,'"',$this->getColAttributes($k),">\n"; |
echo $this->cellDisplay($k, $row, $css_class_name); |
echo '</td>',"\n"; |
} /* }}} */ |
/** |
* Returns CSS class name |
*/ |
function getCSSclass($name, $position = null, $divider = null, $postfix = null) /* {{{ */ |
{ |
static $div_idx = -1; |
$elements = array($this->css['prefix'], $name); |
if ($this->page_type && $this->css['page_type']) { |
if ($this->page_type != 'L' && $this->page_type != 'F') { |
$elements[] = $this->page_types[$this->page_type]; |
} |
} |
if ($position && $this->css['position']) { |
$elements[] = $position; |
} |
if ($divider && $this->css['divider']) { |
if ($divider === 'next') { |
$div_idx++; |
if ($this->css['divider'] > 0 && $div_idx >= $this->css['divider']) { |
$div_idx = 0; |
} |
} |
$elements[] = $div_idx; |
} |
if ($postfix) { |
$elements[] = $postfix; |
} |
return join($this->css['separator'], $elements); |
} /* }}} */ |
/** |
* Returns field cell HTML attributes |
*/ |
function getColAttributes($k) /* {{{ */ |
{ |
$colattrs = ''; |
if (isset($this->fdd[$k]['colattrs'])) { |
$colattrs .= ' '; |
$colattrs .= trim($this->fdd[$k]['colattrs']); |
} |
if (isset($this->fdd[$k]['nowrap'])) { |
$colattrs .= ' nowrap'; |
} |
return $colattrs; |
} /* }}} */ |
/** |
* Substitutes variables in string |
* (this is very simple but secure eval() replacement) |
*/ |
function substituteVars($str, $subst_ar) /* {{{ */ |
{ |
$array = preg_split('/(\\$\w+)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE); |
$count = count($array); |
for ($i = 1; $i < $count; $i += 2) { |
$key = substr($array[$i], 1); |
if (isset($subst_ar[$key])) { |
$array[$i] = $subst_ar[$key]; |
} |
} |
return join('', $array); |
} /* }}} */ |
/** |
* Print URL |
*/ |
function urlDisplay($k, $link_val, $disp_val, $css, $key) /* {{{ */ |
{ |
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true; |
$ret = ''; |
$name = $this->fds[$k]; |
$page = $this->page_name; |
$url = $this->cgi['prefix']['sys'].'rec'.'='.$key.'&'.$this->cgi['prefix']['sys'].'fm' |
.'='.$this->fm.'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl; |
$url .= '&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn; |
$url .= '&'.$this->get_sfn_cgi_vars().$this->cgi['persist']; |
$ar = array( |
'key' => $key, |
'name' => $name, |
'link' => $link_val, |
'value' => $disp_val, |
'css' => $css, |
'page' => $page, |
'url' => $url |
); |
$urllink = isset($this->fdd[$k]['URL']) |
? $this->substituteVars($this->fdd[$k]['URL'], $ar) |
: $link_val; |
$urldisp = isset($this->fdd[$k]['URLdisp']) |
? $this->substituteVars($this->fdd[$k]['URLdisp'], $ar) |
: $disp_val; |
$target = isset($this->fdd[$k]['URLtarget']) |
? 'target="'.htmlspecialchars($this->fdd[$k]['URLtarget']).'" ' |
: ''; |
$prefix_found = false; |
$postfix_found = false; |
$prefix_ar = @$this->fdd[$k]['URLprefix']; |
$postfix_ar = @$this->fdd[$k]['URLpostfix']; |
is_array($prefix_ar) || $prefix_ar = array($prefix_ar); |
is_array($postfix_ar) || $postfix_ar = array($postfix_ar); |
foreach ($prefix_ar as $prefix) { |
if (! strncmp($prefix, $urllink, strlen($prefix))) { |
$prefix_found = true; |
break; |
} |
} |
foreach ($postfix_ar as $postfix) { |
if (! strncmp($postfix, $urllink, strlen($postfix))) { |
$postfix_found = true; |
break; |
} |
} |
$prefix_found || $urllink = array_shift($prefix_ar).$urllink; |
$postfix_found || $urllink = $urllink.array_shift($postfix_ar); |
if (strlen($urllink) <= 0 || strlen($urldisp) <= 0) { |
$ret = ' '; |
} else { |
if ($escape) { |
$urldisp = htmlspecialchars($urldisp); |
} |
$urllink = htmlspecialchars($urllink); |
$ret = '<a '.$target.'class="'.$css.'" href="'.$urllink.'">'.$urldisp.'</a>'; |
} |
return $ret; |
} /* }}} */ |
function cellDisplay($k, $row, $css) /* {{{ */ |
{ |
$escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true; |
$key_rec = $row['qf'.$this->key_num]; |
if (@$this->fdd[$k]['datemask']) { |
$value = intval($row["qf$k".'_timestamp']); |
$value = $value ? @date($this->fdd[$k]['datemask'], $value) : ''; |
} else if (@$this->fdd[$k]['strftimemask']) { |
$value = intval($row["qf$k".'_timestamp']); |
$value = $value ? @strftime($this->fdd[$k]['strftimemask'], $value) : ''; |
} else if ($this->is_values2($k, $row["qf$k"])) { |
$value = $row['qf'.$k.'_idx']; |
if ($this->fdd[$k]['select'] == 'M') { |
$value_ar = explode(',', $value); |
$value_ar2 = array(); |
foreach ($value_ar as $value_key) { |
if (isset($this->fdd[$k]['values2'][$value_key])) { |
$value_ar2[$value_key] = $this->fdd[$k]['values2'][$value_key]; |
$escape = false; |
} |
} |
$value = join(', ', $value_ar2); |
} else { |
if (isset($this->fdd[$k]['values2'][$value])) { |
$value = $this->fdd[$k]['values2'][$value]; |
$escape = false; |
} |
} |
} elseif (isset($this->fdd[$k]['values2'][$row["qf$k"]])) { |
$value = $this->fdd[$k]['values2'][$row["qf$k"]]; |
} else { |
$value = $row["qf$k"]; |
} |
$original_value = $value; |
if (@$this->fdd[$k]['strip_tags']) { |
$value = strip_tags($value); |
} |
if ($num_ar = @$this->fdd[$k]['number_format']) { |
if (! is_array($num_ar)) { |
$num_ar = array($num_ar); |
} |
if (count($num_ar) == 1) { |
list($nbDec) = $num_ar; |
$value = number_format($value, $nbDec); |
} else if (count($num_ar) == 3) { |
list($nbDec, $decPoint, $thSep) = $num_ar; |
$value = number_format($value, $nbDec, $decPoint, $thSep); |
} |
} |
if (intval($this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) { |
$value = ereg_replace("[\r\n\t ]+",' ',$value); |
$value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...'; |
} |
if (@$this->fdd[$k]['mask']) { |
$value = sprintf($this->fdd[$k]['mask'], $value); |
} |
if ($this->col_has_php($k)) { |
return include($this->fdd[$k]['php']); |
} |
if ($this->col_has_URL($k)) { |
return $this->urlDisplay($k, $original_value, $value, $css, $key_rec); |
} |
if (strlen($value) <= 0) { |
return ' '; |
} |
if ($escape) { |
$value = htmlspecialchars($value); |
} |
return nl2br($value); |
} /* }}} */ |
/** |
* Creates HTML submit input element |
* |
* @param name element name |
* @param label key in the language hash used as label |
* @param css_class_name CSS class name |
* @param js_validation if add JavaScript validation subroutine to button |
* @param disabled if mark the button as disabled |
* @param js any extra text in tags |
*/ |
function htmlSubmit($name, $label, $css_class_name, $js_validation = true, $disabled = false, $js = NULL) /* {{{ */ |
{ |
// Note that <input disabled> isn't valid HTML, but most browsers support it |
if($disabled == -1) return; |
$markdisabled = $disabled ? ' disabled="disabled"' : ''; |
$ret = '<input'.$markdisabled.' type="submit" class="'.$css_class_name |
.'" name="'.$this->cgi['prefix']['sys'].ltrim($markdisabled).$name |
.'" value="'.(isset($this->labels[$label]) ? $this->labels[$label] : $label); |
if ($js_validation) { |
$ret .= '" onclick="return '.$this->js['prefix'].'form_control(this.form);'; |
} |
$ret .='"'; |
if(isset($js)) $ret .= ' '.$js; |
$ret .= ' />'; |
return $ret; |
} /* }}} */ |
/** |
* Creates HTML hidden input element |
* |
* @param name element name |
* @param value value |
*/ |
function htmlHiddenSys($name, $value) /* {{{ */ |
{ |
return $this->htmlHidden($this->cgi['prefix']['sys'].$name, $value); |
} /* }}} */ |
function htmlHiddenData($name, $value) /* {{{ */ |
{ |
return $this->htmlHidden($this->cgi['prefix']['data'].$name, $value); |
} /* }}} */ |
function htmlHidden($name, $value) /* {{{ */ |
{ |
return '<input type="hidden" name="'.htmlspecialchars($name) |
.'" value="'.htmlspecialchars($value).'" />'."\n"; |
} /* }}} */ |
/** |
* Creates HTML select element (tag) |
* |
* @param name element name |
* @param css CSS class name |
* @param kv_array key => value array |
* @param selected selected key (it can be single string, array of |
* keys or multiple values separated by comma) |
* @param multiple bool for multiple selection |
* @param readonly bool for readonly/disabled selection |
* @param strip_tags bool for stripping tags from values |
* @param escape bool for HTML escaping values |
* @param js string to be in the <select >, ususally onchange='..'; |
*/ |
function htmlSelect($name, $css, $kv_array, $selected = null, /* ...) {{{ */ |
/* booleans: */ $multiple = false, $readonly = false, $strip_tags = false, $escape = true, $js = NULL) |
{ |
$ret = '<select class="'.htmlspecialchars($css).'" name="'.htmlspecialchars($name); |
if ($multiple) { |
$ret .= '[]" multiple size="'.$this->multiple; |
if (! is_array($selected) && $selected !== null) { |
$selected = explode(',', $selected); |
} |
} |
$ret .= '"'.($readonly ? ' disabled="disabled"' : '').$js.'>'."\n"; |
if (! is_array($selected)) { |
$selected = $selected === null ? array() : array($selected); |
} |
$found = false; |
foreach ($kv_array as $key => $value) { |
$ret .= '<option value="'.htmlspecialchars($key).'"'; |
if ((! $found || $multiple) && in_array((string) $key, $selected, 1) |
|| (count($selected) == 0 && ! $found && ! $multiple)) { |
$ret .= ' selected="selected"'; |
$found = true; |
} |
$strip_tags && $value = strip_tags($value); |
$escape && $value = htmlspecialchars($value); |
$ret .= '>'.$value.'</option>'."\n"; |
} |
$ret .= '</select>'; |
return $ret; |
} /* }}} */ |
/** |
* Creates HTML checkboxes or radio buttons |
* |
* @param name element name |
* @param css CSS class name |
* @param kv_array key => value array |
* @param selected selected key (it can be single string, array of |
* keys or multiple values separated by comma) |
* @param multiple bool for multiple selection (checkboxes) |
* @param readonly bool for readonly/disabled selection |
* @param strip_tags bool for stripping tags from values |
* @param escape bool for HTML escaping values |
* @param js string to be in the <select >, ususally onchange='..'; |
*/ |
function htmlRadioCheck($name, $css, $kv_array, $selected = null, /* ...) {{{ */ |
/* booleans: */ $multiple = false, $readonly = false, $strip_tags = false, $escape = true, $js = NULL) |
{ |
$ret = ''; |
if ($multiple) { |
if (! is_array($selected) && $selected !== null) { |
$selected = explode(',', $selected); |
} |
} |
if (! is_array($selected)) { |
$selected = $selected === null ? array() : array($selected); |
} |
$found = false; |
foreach ($kv_array as $key => $value) { |
$ret .= '<input type="'.($multiple ? 'checkbox' : 'radio').'" name="'; |
$ret .= htmlspecialchars($name).'[]" value="'.htmlspecialchars($key).'"'; |
if ((! $found || $multiple) && in_array((string) $key, $selected, 1) |
|| (count($selected) == 0 && ! $found && ! $multiple)) { |
$ret .= ' checked'; |
$found = true; |
} |
if ($readonly) { |
$ret .= ' disabled="disabled"'; |
} |
$strip_tags && $value = strip_tags($value); |
$escape && $value = htmlspecialchars($value); |
$ret .= '>'.$value.'<br>'."\n"; |
} |
return $ret; |
} /* }}} */ |
/** |
* Returns original variables HTML code for use in forms or links. |
* |
* @param mixed $origvars string or array of original varaibles |
* @param string $method type of method ("POST" or "GET") |
* @param mixed $default_value default value of variables |
* if null, empty values will be skipped |
* @return get HTML code of original varaibles |
*/ |
function get_origvars_html($origvars, $method = 'post', $default_value = '') /* {{{ */ |
{ |
$ret = ''; |
$method = strtoupper($method); |
if ($method == 'POST') { |
if (! is_array($origvars)) { |
$new_origvars = array(); |
foreach (explode('&', $origvars) as $param) { |
$parts = explode('=', $param, 2); |
if (! isset($parts[1])) { |
$parts[1] = $default_value; |
} |
if (strlen($parts[0]) <= 0) { |
continue; |
} |
$new_origvars[$parts[0]] = $parts[1]; |
} |
$origvars =& $new_origvars; |
} |
foreach ($origvars as $key => $val) { |
if (strlen($val) <= 0 && $default_value === null) { |
continue; |
} |
$key = rawurldecode($key); |
$val = rawurldecode($val); |
$ret .= $this->htmlHidden($key, $val); |
} |
} else if (! strncmp('GET', $method, 3)) { |
if (! is_array($origvars)) { |
$ret .= $origvars; |
} else { |
foreach ($origvars as $key => $val) { |
if (strlen($val) <= 0 && $default_value === null) { |
continue; |
} |
$ret == '' || $ret .= '&'; |
$ret .= htmlspecialchars(rawurlencode($key)); |
$ret .= '='; |
$ret .= htmlspecialchars(rawurlencode($val)); |
} |
} |
if ($method[strlen($method) - 1] == '+') { |
$ret = "?$ret"; |
} |
} else { |
trigger_error('Unsupported Platon::get_origvars_html() method: ' |
.$method, E_USER_ERROR); |
} |
return $ret; |
} /* }}} */ |
function get_sfn_cgi_vars($alternative_sfn = null) /* {{{ */ |
{ |
if ($alternative_sfn === null) { // FAST! (cached return value) |
static $ret = null; |
$ret == null && $ret = $this->get_sfn_cgi_vars($this->sfn); |
return $ret; |
} |
$ret = ''; |
$i = 0; |
foreach ($alternative_sfn as $val) { |
$ret != '' && $ret .= '&'; |
$ret .= rawurlencode($this->cgi['prefix']['sys'].'sfn')."[$i]=".rawurlencode($val); |
$i++; |
} |
return $ret; |
} /* }}} */ |
function get_default_cgi_prefix($type) /* {{{ */ |
{ |
switch ($type) { |
case 'operation': return 'PME_op_'; |
case 'sys': return 'PME_sys_'; |
case 'data': return 'PME_data_'; |
} |
return ''; |
} /* }}} */ |
function get_sys_cgi_var($name, $default_value = null) /* {{{ */ |
{ |
if (isset($this)) { |
return $this->get_cgi_var($this->cgi['prefix']['sys'].$name, $default_value); |
} |
return phpMyEdit::get_cgi_var(phpMyEdit::get_default_cgi_prefix('sys').$name, $default_value); |
} /* }}} */ |
function get_data_cgi_var($name, $default_value = null) /* {{{ */ |
{ |
if (isset($this)) { |
return $this->get_cgi_var($this->cgi['prefix']['data'].$name, $default_value); |
} |
return phpMyEdit::get_cgi_var(phpMyEdit::get_default_cgi_prefix('data').$name, $default_value); |
} /* }}} */ |
function get_cgi_var($name, $default_value = null) /* {{{ */ |
{ |
if (isset($this) && isset($this->cgi['overwrite'][$name])) { |
return $this->cgi['overwrite'][$name]; |
} |
static $magic_quotes_gpc = null; |
if ($magic_quotes_gpc === null) { |
$magic_quotes_gpc = get_magic_quotes_gpc(); |
} |
$var = @$_GET[$name]; |
if (! isset($var)) { |
$var = @$_POST[$name]; |
} |
if (isset($var)) { |
if ($magic_quotes_gpc) { |
if (is_array($var)) { |
foreach (array_keys($var) as $key) { |
$var[$key] = stripslashes($var[$key]); |
} |
} else { |
$var = stripslashes($var); |
} |
} |
} else { |
$var = @$default_value; |
} |
if (isset($this) && $var === null && isset($this->cgi['append'][$name])) { |
return $this->cgi['append'][$name]; |
} |
return $var; |
} /* }}} */ |
function get_server_var($name) /* {{{ */ |
{ |
if (isset($_SERVER[$name])) { |
return $_SERVER[$name]; |
} |
global $HTTP_SERVER_VARS; |
if (isset($HTTP_SERVER_VARS[$name])) { |
return $HTTP_SERVER_VARS[$name]; |
} |
global $$name; |
if (isset($$name)) { |
return $$name; |
} |
return null; |
} /* }}} */ |
/* |
* Debug functions |
*/ |
function print_get_vars ($miss = 'No GET variables found') // debug only /* {{{ */ |
{ |
// we parse form GET variables |
if (is_array($_GET)) { |
echo "<p> Variables per GET "; |
foreach ($_GET as $k => $v) { |
if (is_array($v)) { |
foreach ($v as $akey => $aval) { |
// $_GET[$k][$akey] = strip_tags($aval); |
// $$k[$akey] = strip_tags($aval); |
echo "$k\[$akey\]=$aval "; |
} |
} else { |
// $_GET[$k] = strip_tags($val); |
// $$k = strip_tags($val); |
echo "$k=$v "; |
} |
} |
echo '</p>'; |
} else { |
echo '<p>'; |
echo $miss; |
echo '</p>'; |
} |
} /* }}} */ |
function print_post_vars($miss = 'No POST variables found') // debug only /* {{{ */ |
{ |
global $_POST; |
// we parse form POST variables |
if (is_array($_POST)) { |
echo "<p>Variables per POST "; |
foreach ($_POST as $k => $v) { |
if (is_array($v)) { |
foreach ($v as $akey => $aval) { |
// $_POST[$k][$akey] = strip_tags($aval); |
// $$k[$akey] = strip_tags($aval); |
echo "$k\[$akey\]=$aval "; |
} |
} else { |
// $_POST[$k] = strip_tags($val); |
// $$k = strip_tags($val); |
echo "$k=$v "; |
} |
} |
echo '</p>'; |
} else { |
echo '<p>'; |
echo $miss; |
echo '</p>'; |
} |
} /* }}} */ |
function print_vars ($miss = 'Current instance variables') // debug only /* {{{ */ |
{ |
echo "$miss "; |
echo 'page_name=',$this->page_name,' '; |
echo 'hn=',$this->hn,' '; |
echo 'un=',$this->un,' '; |
echo 'pw=',$this->pw,' '; |
echo 'db=',$this->db,' '; |
echo 'dbp=',$this->dbp,' '; |
echo 'dbh=',$this->dbh,' '; |
echo 'tb=',$this->tb,' '; |
echo 'key=',$this->key,' '; |
echo 'key_type=',$this->key_type,' '; |
echo 'inc=',$this->inc,' '; |
echo 'options=',$this->options,' '; |
echo 'fdd=',$this->fdd,' '; |
echo 'fl=',$this->fl,' '; |
echo 'fm=',$this->fm,' '; |
echo 'sfn=',htmlspecialchars($this->get_sfn_cgi_vars()),' '; |
echo 'qfn=',$this->qfn,' '; |
echo 'sw=',$this->sw,' '; |
echo 'rec=',$this->rec,' '; |
echo 'navop=',$this->navop,' '; |
echo 'saveadd=',$this->saveadd,' '; |
echo 'moreadd=',$this->moreadd,' '; |
echo 'canceladd=',$this->canceladd,' '; |
echo 'savechange=',$this->savechange,' '; |
echo 'morechange=',$this->morechange,' '; |
echo 'cancelchange=',$this->cancelchange,' '; |
echo 'savecopy=',$this->savecopy,' '; |
echo 'cancelcopy=',$this->cancelcopy,' '; |
echo 'savedelete=',$this->savedelete,' '; |
echo 'canceldelete=',$this->canceldelete,' '; |
echo 'cancelview=',$this->cancelview,' '; |
echo 'operation=',$this->operation,' '; |
echo "\n"; |
} /* }}} */ |
/* |
* Display buttons at top and bottom of page |
*/ |
function display_list_table_buttons($position, $listall = false) /* {{{ */ |
{ |
if (($but_str = $this->display_buttons($position)) === null) |
return; |
if($position == 'down') echo '<hr class="'.$this->getCSSclass('hr', 'down').'" />'."\n"; |
echo '<table summary="navigation" class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
echo $but_str,'</td>',"\n"; |
// Message is now written here |
if (strlen(@$this->message) > 0) { |
echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n"; |
} |
if($this->display['num_pages'] || $this->display['num_records']) |
echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n"; |
if($this->display['num_pages']) { |
if ($listall) { |
echo $this->labels['Page'],': 1 ',$this->labels['of'],' 1'; |
} else { |
$current_page = intval($this->fm / $this->inc) + 1; |
$total_pages = max(1, ceil($this->total_recs / abs($this->inc))); |
echo $this->labels['Page'],': ',$current_page; |
echo ' ',$this->labels['of'],' ',$total_pages; |
} |
} |
if($this->display['num_records']) |
echo ' ',$this->labels['Records'],': ',$this->total_recs; |
if($this->display['num_pages'] || $this->display['num_records']) echo '</td>'; |
echo '</tr></table>',"\n"; |
if($position == 'up') echo '<hr class="'.$this->getCSSclass('hr', 'up').'" />'."\n"; |
} /* }}} */ |
/* |
* Display buttons at top and bottom of page |
*/ |
function display_record_buttons($position) /* {{{ */ |
{ |
if (($but_str = $this->display_buttons($position)) === null) |
return; |
if ($position == 'down') { |
if ($this->tabs_enabled()) $this->display_tab_labels('down'); |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'" />',"\n"; |
} |
echo '<table summary="navigation" class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
echo $but_str,'</td>',"\n"; |
// Message is now written here |
//echo '</td>',"\n"; |
if (strlen(@$this->message) > 0) { |
echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n"; |
} |
echo '</tr></table>',"\n"; |
if ($position == 'up') { |
if ($this->tabs_enabled()) $this->display_tab_labels('up'); |
echo '<hr class="',$this->getCSSclass('hr', 'up'),'" />',"\n"; |
} |
} /* }}} */ |
function display_buttons($position) /* {{{ */ |
{ |
$nav_fnc = 'nav_'.$position; |
if(! $this->$nav_fnc()) |
return; |
$buttons = (is_array($this->buttons[$this->page_type][$position])) |
? $this->buttons[$this->page_type][$position] |
: $this->default_buttons[$this->page_type]; |
foreach ($buttons as $name) { |
$ret .= $this->display_button($name, $position)."\n"; |
} |
return $ret; |
} /* }}} */ |
function display_button($name, $position = 'up') /* {{{ */ |
{ |
if (is_array($name)) { |
if (isset($name['code'])) return $name['code']; |
return $this->htmlSubmit($name['name'], $name['value'], $name['css'], $name['disabled'], $name['js']); |
} |
$disabled = 1; // show disabled by default |
if ($name[0] == '+') { $name = substr($name, 1); $disabled = 0; } // always show disabled as enabled |
if ($name[0] == '-') { $name = substr($name, 1); $disabled = -1; } // don't show disabled |
if ($name == 'cancel') { |
return $this->htmlSubmit('cancel'.$this->page_types[$this->page_type], 'Cancel', |
$this->getCSSclass('cancel', $position), false); |
} |
if (in_array($name, array('add','view','change','copy','delete'))) { |
$enabled_fnc = $name.'_enabled'; |
$enabled = $this->$enabled_fnc(); |
if ($name != 'add' && ! $this->total_recs && strstr('LF', $this->page_type)) |
$enabled = false; |
return $this->htmlSubmit('operation', ucfirst($name), |
$this->getCSSclass($name, $position), false, $enabled ? 0 : $disabled); |
} |
if ($name == 'savedelete') { |
$enabled = $this->delete_enabled(); |
$js = 'onclick="return confirm(\''.$this->labels['Delete'].' ?\');"'; |
return $this->htmlSubmit('savedelete', 'Delete', |
$this->getCSSclass('save', $position), false, $enabled ? 0 : $disabled, $js); |
} |
if (in_array($name, array('save','more'))) { |
$validation = true; // if js validation |
if ($this->page_type == 'D' && $name == 'save' ) { $value = 'Delete'; $validation = false; } |
elseif ($this->page_type == 'C' && $name == 'more' ) { $value = 'Apply'; } |
else $value = ucfirst($name); |
return $this->htmlSubmit($name.$this->page_types[$this->page_type], $value, |
$this->getCSSclass($name, $position), $validation); |
} |
$listall = $this->inc <= 0; |
if ($listall) { |
$disabledprev = true; |
$disablednext = true; |
$total_pages = 1; |
$current_page = 1; |
} else { |
$disabledprev = $this->fm <= 0; |
$disablednext = $this->fm + $this->inc >= $this->total_recs; |
$total_pages = max(1, ceil($this->total_recs / abs($this->inc))); |
$current_page = ceil($this->fm / abs($this->inc)); // must + 1 |
} |
$disabledfirst = $disabledprev; |
$disabledlast = $disablednext; |
// some statistics first |
if ($name == 'total_pages') return $total_pages; |
if ($name == 'current_page') return ($current_page+1); |
if ($name == 'total_recs') return ($this->total_recs); |
// now some goto buttons/dropdowns/inputs... |
if ($name == 'goto_text') { |
$ret = '<input type="text" class="'.$this->getCSSclass('gotopn', $position).'"'; |
$ret .= ' name="'.$this->cgi['prefix']['sys'].'navpn'.$position.'" value="'.($current_page+1).'"'; |
$ret .= ' size="'.(strlen($total_pages)+1).'" maxlength="'.(strlen($total_pages)+1).'"'; |
// TODO some js here.... on enter submit, on click erase ?... |
$ret .=' oneypress="return PE_filter_handler(this.form, event);" />'; |
return $ret; |
} |
if ($name == 'goto_combo') { |
$disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled'; |
if ($disablegoto != '' && $disabled < 0) return; |
$kv_array = array(); |
for ($i = 0; $i < $total_pages; $i++) { |
$kv_array[$this->inc * $i] = $i + 1; |
} |
// TODO: add onchange="return this.form.submit();" DONE ??? |
return $this->htmlSelect($this->cgi['prefix']['sys'].ltrim($disabledgoto).'navfm'.$position, |
$this->getCSSclass('goto', $position), $kv_array, (string)$this->fm, false, $disabledgoto, |
false, true, 'onchange="return this.form.submit();"'); |
} |
if ($name == 'goto') { |
return $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), |
false, ($listall || ($disablednext && $disabledprev)) ? $disabled : 0); |
} |
if (in_array($name, array('first','prev','next','last','<<','<','>','>>'))) { |
$disabled_var = 'disabled'.$name; |
$name2 = $name; |
if (strlen($name) <= 2) { |
$nav_values = array('<<' => 'first', '<' => 'prev', '>' => 'next', '>>' => 'last'); |
$disabled_var = 'disabled'.$nav_values[$name]; |
$name2 = $nav_values[$name]; |
} |
return $this->htmlSubmit('navop', ucfirst($name), |
$this->getCSSclass($name2, $position), false, $$disabled_var ? $disabled : 0); |
} |
if(isset($this->labels[$name])) return $this->labels[$name]; |
return $name; |
} /* }}} */ |
function number_of_recs() /* {{{ */ |
{ |
$count_parts = array( |
'type' => 'select', |
'select' => 'count(*)', |
'from' => $this->get_SQL_join_clause(), |
'where' => $this->get_SQL_where_from_query_opts()); |
$res = $this->myquery($this->get_SQL_query($count_parts), __LINE__); |
$row = @mysql_fetch_array($res, MYSQL_NUM); |
$this->total_recs = $row[0]; |
} /* }}} */ |
/* |
* Table Page Listing |
*/ |
function list_table() /* {{{ */ |
{ |
if ($this->fm == '') { |
$this->fm = 0; |
} |
$this->fm = $this->navfm; |
if ($this->prev_operation()) { |
$this->fm = $this->fm - $this->inc; |
if ($this->fm < 0) { |
$this->fm = 0; |
} |
} |
if ($this->first_operation()) { |
$this->fm = 0; |
} // last operation must be performed below, after retrieving total_recs |
if ($this->next_operation()) { |
$this->fm += $this->inc; |
} |
$this->number_of_recs(); |
if ($this->last_operation() || $this->fm > $this->total_recs) { // if goto_text is badly set |
$this->fm = (int)(($this->total_recs - 1)/$this->inc)*$this->inc; |
} |
// If sort sequence has changed, restart listing |
$this->qfn != $this->prev_qfn && $this->fm = 0; |
if (0) { // DEBUG |
echo 'qfn vs. prev_qfn comparsion '; |
echo '[<b>',htmlspecialchars($this->qfn),'</b>]'; |
echo '[<b>',htmlspecialchars($this->prev_qfn),'</b>]<br />'; |
echo 'comparsion <u>',($this->qfn == $this->prev_qfn ? 'proved' : 'failed'),'</u>'; |
echo '<hr />'; |
} |
/* |
* If user is allowed to Change/Delete records, we need an extra column |
* to allow users to select a record |
*/ |
$select_recs = $this->key != '' && |
($this->change_enabled() || $this->delete_enabled() || $this->view_enabled()); |
// Are we doing a listall? |
$listall = $this->inc <= 0; |
/* |
* Display the MySQL table in an HTML table |
*/ |
$this->form_begin(); |
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->htmlHiddenSys('fl', $this->fl); |
// Display buttons at top and/or bottom of page. |
$this->display_list_table_buttons('up', $listall); |
if ($this->cgi['persist'] != '') { |
echo $this->get_origvars_html($this->cgi['persist']); |
} |
if (! $this->filter_operation()) { |
echo $this->get_origvars_html($this->qfn); |
} |
echo $this->htmlHiddenSys('qfn', $this->qfn); |
echo $this->htmlHiddenSys('fm', $this->fm); |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
echo '<tr class="',$this->getCSSclass('header'),'">',"\n"; |
/* |
* System (navigation, selection) columns counting |
*/ |
$sys_cols = 0; |
$sys_cols += intval($this->filter_enabled() || $select_recs); |
if ($sys_cols > 0) { |
$sys_cols += intval($this->nav_buttons() |
&& ($this->nav_text_links() || $this->nav_graphic_links())); |
} |
/* |
* We need an initial column(s) (sys columns) |
* if we have filters, Changes or Deletes enabled |
*/ |
if ($sys_cols) { |
echo '<th class="',$this->getCSSclass('header'),'" colspan="',$sys_cols,'">'; |
if ($this->filter_enabled()) { |
if ($this->filter_operation()) { |
echo $this->htmlSubmit('sw', 'Hide', $this->getCSSclass('hide'), false); |
echo $this->htmlSubmit('sw', 'Clear', $this->getCSSclass('clear'), false); |
} else { |
echo $this->htmlSubmit('sw', 'Search', $this->getCSSclass('search'), false); |
} |
} else { |
echo ' '; |
} |
echo '</th>',"\n"; |
} |
for ($k = 0; $k < $this->num_fds; $k++) { |
$fd = $this->fds[$k]; |
if (! $this->displayed[$k]) { |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('header', null, null, $css_postfix); |
$fdn = $this->fdd[$fd]['name']; |
if (! $this->fdd[$fd]['sort'] || $this->password($fd)) { |
echo '<th class="',$css_class_name,'">',$fdn,'</th>',"\n"; |
} else { |
// Clicking on the current sort field reverses the sort order |
$new_sfn = $this->sfn; |
array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k); |
echo '<th class="',$css_class_name,'">'; |
echo '<a class="',$css_class_name,'" href="'; |
echo htmlspecialchars($this->page_name.'?'.$this->cgi['prefix']['sys'].'fm'.'=0' |
.'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn |
.'&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']); |
echo '">',$fdn,'</a></th>',"\n"; |
} |
} |
echo '</tr>',"\n"; |
/* |
* Prepare the SQL Query from the data definition file |
*/ |
$qparts['type'] = 'select'; |
$qparts['select'] = $this->get_SQL_column_list(); |
// Even if the key field isn't displayed, we still need its value |
if ($select_recs) { |
if (!in_array ($this->key, $this->fds)) { |
$qparts['select'] .= ','.$this->fqn($this->key); |
} |
} |
$qparts['from'] = $this->get_SQL_join_clause(); |
$qparts['where'] = $this->get_SQL_where_from_query_opts(); |
// build up the ORDER BY clause |
if (isset($this->sfn)) { |
$sort_fields = array(); |
$sort_fields_w = array(); |
foreach ($this->sfn as $field) { |
if ($field[0] == '-') { |
$field = substr($field, 1); |
$desc = true; |
} else { |
$field = $field; |
$desc = false; |
} |
$sort_field = $this->fqn($field); |
$sort_field_w = $this->fdd[$field]['name']; |
$this->col_has_sql($field) && $sort_field_w .= ' (sql)'; |
if ($desc) { |
$sort_field .= ' DESC'; |
$sort_field_w .= ' '.$this->labels['descending']; |
} else { |
$sort_field_w .= ' '.$this->labels['ascending']; |
} |
$sort_fields[] = $sort_field; |
$sort_fields_w[] = $sort_field_w; |
} |
if (count($sort_fields) > 0) { |
$qparts['orderby'] = join(',', $sort_fields); |
} |
} |
$qparts['limit'] = $listall ? '' : $this->fm.','.$this->inc; |
/* |
* Main list_table() query |
* |
* Each row of the HTML table is one record from the SQL query. We must |
* perform this query before filter printing, because we want to use |
* mysql_field_len() function. We will also fetch the first row to get |
* the field names. |
*/ |
$query = $this->get_SQL_query($qparts); |
$res = $this->myquery($query, __LINE__); |
if ($res == false) { |
$this->error('invalid SQL query', $query); |
return false; |
} |
$row = @mysql_fetch_array($res, MYSQL_ASSOC); |
/* FILTER {{{ |
* |
* Draw the filter and fill it with any data typed in last pass and stored |
* in the array parameter keyword 'filter'. Prepare the SQL WHERE clause. |
*/ |
if ($this->filter_operation()) { |
// Filter row retrieval |
$fields = false; |
$filter_row = $row; |
if (! is_array($filter_row)) { |
unset($qparts['where']); |
$query = $this->get_SQL_query($qparts); |
$res = $this->myquery($query, __LINE__); |
if ($res == false) { |
$this->error('invalid SQL query', $query); |
return false; |
} |
$filter_row = @mysql_fetch_array($res, MYSQL_ASSOC); |
} |
/* Variable $fields is used to get index of particular field in |
result. That index can be passed in example to mysql_field_len() |
function. Use field names as indexes to $fields array. */ |
if (is_array($filter_row)) { |
$fields = array_flip(array_keys($filter_row)); |
} |
if ($fields != false) { |
$css_class_name = $this->getCSSclass('filter'); |
echo '<tr class="',$css_class_name,'">',"\n"; |
echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">'; |
echo $this->htmlSubmit('filter', 'Query', $this->getCSSclass('query'), false); |
echo '</td>', "\n"; |
for ($k = 0; $k < $this->num_fds; $k++) { |
if (! $this->displayed[$k]) { |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('filter', null, null, $css_postfix); |
$this->field_name = $this->fds[$k]; |
$fd = $this->field_name; |
$this->field = $this->fdd[$fd]; |
$l = 'qf'.$k; |
$lc = 'qf'.$k.'_comp'; |
$li = 'qf'.$k.'_id'; |
if ($this->clear_operation()) { |
$m = null; |
$mc = null; |
$mi = null; |
} else { |
$m = $this->get_sys_cgi_var($l); |
$mc = $this->get_sys_cgi_var($lc); |
$mi = $this->get_sys_cgi_var($li); |
} |
echo '<td class="',$css_class_name,'">'; |
if ($this->password($k)) { |
echo ' '; |
} else if ($this->fdd[$fd]['select'] == 'D' || $this->fdd[$fd]['select'] == 'M') { |
// Multiple fields processing |
// Default size is 2 and array required for values. |
$from_table = ! $this->col_has_values($k) || isset($this->fdd[$k]['values']['table']); |
$vals = $this->set_values($k, array('*' => '*'), null, $from_table); |
$selected = $mi; |
$multiple = $this->col_has_multiple_select($k); |
$multiple |= $this->fdd[$fd]['select'] == 'M'; |
$readonly = false; |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_id', $css_class_name, |
$vals, $selected, $multiple, $readonly, $strip_tags, $escape); |
} elseif ($this->fdd[$fd]['select'] == 'N' || $this->fdd[$fd]['select'] == 'T') { |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$maxlen > 0 || $maxlen = intval(@mysql_field_len($res, $fields["qf$k"])); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] |
: ($maxlen < 30 ? min($maxlen, 8) : 12); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
if ($this->fdd[$fd]['select'] == 'N') { |
$mc = in_array($mc, $this->comp_ops) ? $mc : '='; |
echo $this->htmlSelect($this->cgi['prefix']['sys'].$l.'_comp', |
$css_class_name, $this->comp_ops, $mc); |
} |
echo '<input class="',$css_class_name,'" value="',htmlspecialchars(@$m); |
echo '" type="text" name="'.$this->cgi['prefix']['sys'].'qf'.$k.'"',$size_ml_props; |
echo ' onkeypress="return '.$this->js['prefix'].'filter_handler(this.form, event);" />'; |
} else { |
echo ' '; |
} |
echo '</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} // }}} |
/* |
* Display sorting sequence |
*/ |
if ($qparts['orderby'] && $this->display['sort']) { |
$css_class_name = $this->getCSSclass('sortinfo'); |
echo '<tr class="',$css_class_name,'">',"\n"; |
echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">'; |
echo '<a class="',$css_class_name,'" href="'; |
echo htmlspecialchars($this->page_name |
.'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
.$this->qfn.$this->cgi['persist']); |
echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
echo $this->labels['Sorted By'],': ',join(', ', $sort_fields_w),'</td></tr>',"\n"; |
} |
/* |
* Display the current query |
*/ |
$text_query = $this->get_SQL_where_from_query_opts(null, true); |
if ($text_query != '' && $this->display['query']) { |
$css_class_name = $this->getCSSclass('queryinfo'); |
echo '<tr class="',$css_class_name,'">',"\n"; |
echo '<td class="',$css_class_name,'" colspan="',$sys_cols,'">'; |
echo '<a class="',$css_class_name,'" href="'; |
echo htmlspecialchars($this->get_server_var('PHP_SELF') |
.'?'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl |
.'&'.$this->cgi['prefix']['sys'].'fm'.'='.$this->fm |
.'&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn) |
.'&'.$this->get_sfn_cgi_vars().$this->cgi['persist']); |
echo '">',$this->labels['Clear'],'</a></td>',"\n"; |
echo '<td class="',$css_class_name,'" colspan="',$this->num_fields_displayed,'">'; |
echo $this->labels['Current Query'],': ',htmlspecialchars($text_query),'</td></tr>',"\n"; |
} |
if ($this->nav_text_links() || $this->nav_graphic_links()) { |
$qstrparts = array(); |
strlen($this->fl) > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fl'.'='.$this->fl; |
strlen($this->fm) > 0 && $qstrparts[] = $this->cgi['prefix']['sys'].'fm'.'='.$this->fm; |
count($this->sfn) > 0 && $qstrparts[] = $this->get_sfn_cgi_vars(); |
strlen($this->cgi['persist']) > 0 && $qstrparts[] = $this->cgi['persist']; |
$qpview = $qstrparts; |
$qpcopy = $qstrparts; |
$qpchange = $qstrparts; |
$qpdelete = $qstrparts; |
$qp_prefix = $this->cgi['prefix']['sys'].'operation'.'='.$this->cgi['prefix']['operation']; |
$qpview[] = $qp_prefix.'View'; |
$qpcopy[] = $qp_prefix.'Copy'; |
$qpchange[] = $qp_prefix.'Change'; |
$qpdelete[] = $qp_prefix.'Delete'; |
$qpviewStr = htmlspecialchars($this->page_name.'?'.join('&',$qpview).$this->qfn); |
$qpcopyStr = htmlspecialchars($this->page_name.'?'.join('&',$qpcopy).$this->qfn); |
$qpchangeStr = htmlspecialchars($this->page_name.'?'.join('&',$qpchange).$this->qfn); |
$qpdeleteStr = htmlspecialchars($this->page_name.'?'.join('&',$qpdelete).$this->qfn); |
} |
$fetched = true; |
$first = true; |
$rowCount = 0; |
while ((!$fetched && ($row = @mysql_fetch_array($res, MYSQL_ASSOC)) != false) |
|| ($fetched && $row != false)) { |
$fetched = false; |
echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n"; |
if ($sys_cols) { /* {{{ */ |
$key_rec = $row['qf'.$this->key_num]; |
$queryAppend = htmlspecialchars('&'.$this->cgi['prefix']['sys'].'rec'.'='.$key_rec); |
$viewQuery = $qpviewStr . $queryAppend; |
$copyQuery = $qpcopyStr . $queryAppend; |
$changeQuery = $qpchangeStr . $queryAppend; |
$deleteQuery = $qpdeleteStr . $queryAppend; |
$viewTitle = htmlspecialchars($this->labels['View']); |
$changeTitle = htmlspecialchars($this->labels['Change']); |
$copyTitle = htmlspecialchars($this->labels['Copy']); |
$deleteTitle = htmlspecialchars($this->labels['Delete']); |
$css_class_name = $this->getCSSclass('navigation', null, true); |
if ($select_recs) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
echo '<td class="',$css_class_name,'">'; |
} |
if ($this->nav_graphic_links()) { |
$printed_out = false; |
if ($this->view_enabled()) { |
$printed_out = true; |
echo '<a class="',$css_class_name,'" href="',$viewQuery,'"><img class="'; |
echo $css_class_name,'" src="',$this->url['images']; |
echo 'pme-view.png" height="15" width="16" border="0" '; |
echo 'alt="',$viewTitle,'" title="',$viewTitle,'" /></a>'; |
} |
if ($this->change_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a class="',$css_class_name,'" href="',$changeQuery,'"><img class="'; |
echo $css_class_name,'" src="',$this->url['images']; |
echo 'pme-change.png" height="15" width="16" border="0" '; |
echo 'alt="',$changeTitle,'" title="',$changeTitle,'" /></a>'; |
} |
if ($this->copy_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a class="',$css_class_name,'" href="',$copyQuery,'"><img class="'; |
echo $css_class_name,'" src="',$this->url['images']; |
echo 'pme-copy.png" height="15" width="16" border="0" '; |
echo 'alt="',$copyTitle,'" title="',$copyTitle,'" /></a>'; |
} |
if ($this->delete_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a class="',$css_class_name,'" href="',$deleteQuery,'"><img class="'; |
echo $css_class_name,'" src="',$this->url['images']; |
echo 'pme-delete.png" height="15" width="16" border="0" '; |
echo 'alt="',$deleteTitle,'" title="',$deleteTitle,'" /></a>'; |
} |
} |
if ($this->nav_text_links()) { |
if ($this->nav_graphic_links()) { |
echo '<br class="',$css_class_name,'">'; |
} |
$printed_out = false; |
if ($this->view_enabled()) { |
$printed_out = true; |
echo '<a href="',$viewQuery,'" title="',$viewTitle,'" class="',$css_class_name,'">V</a>'; |
} |
if ($this->change_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a href="',$changeQuery,'" title="',$changeTitle,'" class="',$css_class_name,'">C</a>'; |
} |
if ($this->copy_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a href="',$copyQuery,'" title="',$copyTitle,'" class="',$css_class_name,'">P</a>'; |
} |
if ($this->delete_enabled()) { |
$printed_out && print(' '); |
$printed_out = true; |
echo '<a href="',$deleteQuery,'" title="',$deleteTitle,'" class="',$css_class_name,'">D</a>'; |
} |
} |
if (! $this->nav_buttons() || $sys_cols > 1) { |
echo '</td>',"\n"; |
} |
if ($this->nav_buttons()) { |
echo '<td class="',$css_class_name,'"><input class="',$css_class_name; |
echo '" type="radio" name="'.$this->cgi['prefix']['sys'].'rec'; |
echo '" value="',htmlspecialchars($key_rec),'"'; |
if (($this->rec == '' && $first) || ($this->rec == $key_rec)) { |
echo ' checked'; |
$first = false; |
} |
echo ' /></td>',"\n"; |
} |
} elseif ($this->filter_enabled()) { |
echo '<td class="',$css_class_name,'" colspan=',$sys_cols,'> </td>',"\n"; |
} |
} /* }}} */ |
for ($k = 0; $k < $this->num_fds; $k++) { /* {{{ */ |
$fd = $this->fds[$k]; |
if (! $this->displayed[$k]) { |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('cell', null, true, $css_postfix); |
if ($this->password($k)) { |
echo '<td class="',$css_class_name,'">',$this->labels['hidden'],'</td>',"\n"; |
continue; |
} |
echo '<td class="',$css_class_name,'"',$this->getColAttributes($fd),'>'; |
echo $this->cellDisplay($k, $row, $css_class_name); |
echo '</td>',"\n"; |
} /* }}} */ |
echo '</tr>',"\n"; |
} |
/* |
* Display and accumulate column aggregation info, do totalling query |
* XXX this feature does not work yet!!! |
*/ |
// aggregates listing (if any) |
if ($$var_to_total) { |
// do the aggregate query if necessary |
//if ($vars_to_total) { |
$qp = array(); |
$qp['type'] = 'select'; |
$qp['select'] = $aggr_from_clause; |
$qp['from'] = $this->get_SQL_join_clause(); |
$qp['where'] = $this->get_SQL_where_from_query_opts(); |
$tot_query = $this->get_SQL_query($qp); |
$totals_result = $this->myquery($tot_query,__LINE__); |
$tot_row = @mysql_fetch_array($totals_result, MYSQL_ASSOC); |
//} |
$qp_aggr = $qp; |
echo "\n",'<tr class="TODO-class">',"\n",'<td class="TODO-class"> </td>',"\n"; |
/* |
echo '<td>'; |
echo printarray($qp_aggr); |
echo printarray($vars_to_total); |
echo '</td>'; |
echo '<td colspan="'.($this->num_fds-1).'">'.$var_to_total.' '.$$var_to_total.'</td>'; |
*/ |
// display the results |
for ($k=0;$k<$this->num_fds;$k++) { |
$fd = $this->fds[$k]; |
if (stristr($this->fdd[$fd]['options'],'L') or !isset($this->fdd[$fd]['options'])) { |
echo '<td>'; |
$aggr_var = 'qf'.$k.'_aggr'; |
$$aggr_var = $this->get_sys_cgi_var($aggr_var); |
if ($$aggr_var) { |
echo $this->sql_aggrs[$$aggr_var],': ',$tot_row[$aggr_var]; |
} else { |
echo ' '; |
} |
echo '</td>',"\n"; |
} |
} |
echo '</tr>',"\n"; |
} |
echo '</table>',"\n"; // end of table rows listing |
$this->display_list_table_buttons('down', $listall); |
$this->form_end(); |
} /* }}} */ |
function display_record() /* {{{ */ |
{ |
// PRE Triggers |
$ret = true; |
if ($this->change_operation()) { |
$ret &= $this->exec_triggers_simple('update', 'pre'); |
// if PRE update fails, then back to view operation |
if (! $ret) { |
$this->operation = $this->labels['View']; |
$ret = true; |
} |
} |
if ($this->add_operation() || $this->copy_operation()) { |
$ret &= $this->exec_triggers_simple('insert', 'pre'); |
} |
if ($this->view_operation()) { |
$ret &= $this->exec_triggers_simple('select', 'pre'); |
} |
if ($this->delete_operation()) { |
$ret &= $this->exec_triggers_simple('delete', 'pre'); |
} |
// if PRE insert/view/delete fail, then back to the list |
if ($ret == false) { |
$this->operation = ''; |
$this->list_table(); |
return; |
} |
$this->form_begin(); |
if ($this->cgi['persist'] != '') { |
echo $this->get_origvars_html($this->cgi['persist']); |
} |
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->get_origvars_html($this->qfn); |
echo $this->htmlHiddenSys('cur_tab', $this->dhtml['prefix'].'tab'.$this->cur_tab); |
echo $this->htmlHiddenSys('qfn', $this->qfn); |
echo $this->htmlHiddenSys('rec', $this->copy_operation() ? '' : $this->rec); |
echo $this->htmlHiddenSys('fm', $this->fm); |
echo $this->htmlHiddenSys('fl', $this->fl); |
$this->display_record_buttons('up'); |
if ($this->tabs_enabled()) { |
echo '<div id="'.$this->dhtml['prefix'].'tab0">',"\n"; |
} |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
if ($this->add_operation()) { |
$this->display_add_record(); |
} else { |
$this->display_copy_change_delete_record(); |
} |
echo '</table>',"\n"; |
if ($this->tabs_enabled()) { |
echo '</div>',"\n"; |
} |
$this->display_record_buttons('down'); |
$this->form_end(); |
} /* }}} */ |
/* |
* Action functions |
*/ |
function do_add_record() /* {{{ */ |
{ |
// Preparing query |
$query = ''; |
$key_col_val = ''; |
$newvals = array(); |
for ($k = 0; $k < $this->num_fds; $k++) { |
if ($this->processed($k)) { |
$fd = $this->fds[$k]; |
if ($this->readonly($k)) { |
$fn = (string) @$this->fdd[$k]['default']; |
} else { |
$fn = $this->get_data_cgi_var($fd); |
} |
if ($fd == $this->key) { |
$key_col_val = $fn; |
} |
$newvals[$fd] = is_array($fn) ? join(',',$fn) : $fn; |
} |
} |
// Creating array of changed keys ($changed) |
$changed = array_keys($newvals); |
// Before trigger, newvals can be efectively changed |
if ($this->exec_triggers('insert', 'before', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
// Real query (no additional query in this method) |
foreach ($newvals as $fd => $val) { |
if ($fd == '') continue; |
if ($this->col_has_sqlw($this->fdn[$fd])) { |
$val_as = addslashes($val); |
$val_qas = '"'.addslashes($val).'"'; |
$value = $this->substituteVars( |
$this->fdd[$this->fdn[$fd]]['sqlw'], array( |
'val_qas' => $val_qas, |
'val_as' => $val_as, |
'val' => $val |
)); |
} else { |
$value = "'".addslashes($val)."'"; |
} |
if ($query == '') { |
$query = 'INSERT INTO `'.$this->tb.'` (`'.$fd.'`'; // ) |
$query2 = ') VALUES ('.$value.''; |
} else { |
$query .= ', `'.$fd.'`'; |
$query2 .= ', '.$value.''; |
} |
} |
$query .= $query2.')'; |
$res = $this->myquery($query, __LINE__); |
$this->message = @mysql_affected_rows($this->dbh).' '.$this->labels['record added']; |
if (! $res) { |
return false; |
} |
$this->rec = mysql_insert_id($this->dbh); |
// Notify list |
if (@$this->notify['insert'] || @$this->notify['all']) { |
$this->email_notify(false, $newvals); |
} |
// Note change in log table |
if ($this->logtable) { |
$query = sprintf('INSERT INTO %s' |
.' (updated, user, host, operation, tab, rowkey, col, oldval, newval)' |
.' VALUES (NOW(), "%s", "%s", "insert", "%s", "%s", "", "", "%s")', |
$this->logtable, addslashes($this->get_server_var('REMOTE_USER')), |
addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb), |
addslashes($key_col_val), addslashes(serialize($newvals))); |
$this->myquery($query, __LINE__); |
} |
// After trigger |
if ($this->exec_triggers('insert', 'after', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
return true; |
} /* }}} */ |
function do_change_record() /* {{{ */ |
{ |
// Preparing queries |
$query_real = ''; |
$query_oldrec = ''; |
$newvals = array(); |
$oldvals = array(); |
$changed = array(); |
// Prepare query to retrieve oldvals |
for ($k = 0; $k < $this->num_fds; $k++) { |
if ($this->processed($k) && !$this->readonly($k)) { |
$fd = $this->fds[$k]; |
$fn = $this->get_data_cgi_var($fd); |
$newvals[$this->fds[$k]] = is_array($fn) ? join(',',$fn) : $fn; |
if ($query_oldrec == '') { |
$query_oldrec = 'SELECT '.$fd; |
} else { |
$query_oldrec .= ','.$fd; |
} |
} |
} |
$where_part = " WHERE (".$this->key.'='.$this->key_delim.$this->rec.$this->key_delim.')'; |
$query_newrec = $query_oldrec.' FROM ' . $this->tb; |
$query_oldrec .= ' FROM ' . $this->tb . $where_part; |
// Additional query (must go before real query) |
$res = $this->myquery($query_oldrec, __LINE__); |
$oldvals = @mysql_fetch_array($res, MYSQL_ASSOC); |
@mysql_free_result($res); |
// Creating array of changed keys ($changed) |
foreach ($newvals as $fd => $value) { |
if ($value != $oldvals[$fd]) |
$changed[] = $fd; |
} |
// Before trigger |
if ($this->exec_triggers('update', 'before', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
// Build the real query respecting changes to the newvals array |
foreach ($newvals as $fd => $val) { |
if ($fd == '') continue; |
if ($this->col_has_sqlw($this->fdn[$fd])) { |
$val_as = addslashes($val); |
$val_qas = '"'.addslashes($val).'"'; |
$value = $this->substituteVars( |
$this->fdd[$this->fdn[$fd]]['sqlw'], array( |
'val_qas' => $val_qas, |
'val_as' => $val_as, |
'val' => $val |
)); |
} else { |
$value = "'".addslashes($val)."'"; |
} |
if ($query_real == '') { |
$query_real = 'UPDATE '.$this->tb.' SET '.$fd.'='.$value; |
} else { |
$query_real .= ','.$fd.'='.$value; |
} |
} |
$query_real .= $where_part; |
// Real query |
$res = $this->myquery($query_real, __LINE__); |
$this->message = @mysql_affected_rows($this->dbh).' '.$this->labels['record changed']; |
if (! $res) { |
return false; |
} |
// Another additional query (must go after real query) |
if (in_array($this->key, $changed)) { |
$this->rec = $newvals[$this->key]; // key has changed |
} |
$query_newrec .= ' WHERE ('.$this->key.'='.$this->key_delim.$this->rec.$this->key_delim.')'; |
$res = $this->myquery($query_newrec, __LINE__); |
$newvals = @mysql_fetch_array($res, MYSQL_ASSOC); |
@mysql_free_result($res); |
// Creating array of changed keys ($changed) |
$changed = array(); |
foreach ($newvals as $fd => $value) { |
if ($value != $oldvals[$fd]) |
$changed[] = $fd; |
} |
// Notify list |
if (@$this->notify['update'] || @$this->notify['all']) { |
if (count($changed) > 0) { |
$this->email_notify($oldvals, $newvals); |
} |
} |
// Note change in log table |
if ($this->logtable) { |
foreach ($changed as $key) { |
$qry = sprintf('INSERT INTO %s' |
.' (updated, user, host, operation, tab, rowkey, col, oldval, newval)' |
.' VALUES (NOW(), "%s", "%s", "update", "%s", "%s", "%s", "%s", "%s")', |
$this->logtable, addslashes($this->get_server_var('REMOTE_USER')), |
addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb), |
addslashes($this->rec), addslashes($key), |
addslashes($oldvals[$key]), addslashes($newvals[$key])); |
$this->myquery($qry, __LINE__); |
} |
} |
// After trigger |
if ($this->exec_triggers('update', 'after', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
return true; |
} /* }}} */ |
function do_delete_record() /* {{{ */ |
{ |
// Additional query |
$query = 'SELECT * FROM '.$this->tb.' WHERE ('.$this->key.' = ' |
.$this->key_delim.$this->rec.$this->key_delim.')'; // ) |
$res = $this->myquery($query, __LINE__); |
$oldvals = @mysql_fetch_array($res, MYSQL_ASSOC); |
@mysql_free_result($res); |
// Creating array of changed keys ($changed) |
$changed = array_keys($oldvals); |
$newvals = array(); |
// Before trigger |
if ($this->exec_triggers('delete', 'before', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
// Real query |
$query = 'DELETE FROM '.$this->tb.' WHERE ('.$this->key.' = ' |
.$this->key_delim.$this->rec.$this->key_delim.')'; // ) |
$res = $this->myquery($query, __LINE__); |
$this->message = @mysql_affected_rows($this->dbh).' '.$this->labels['record deleted']; |
if (! $res) { |
return false; |
} |
// Notify list |
if (@$this->notify['delete'] || @$this->notify['all']) { |
$this->email_notify($oldvals, false); |
} |
// Note change in log table |
if ($this->logtable) { |
$query = sprintf('INSERT INTO %s' |
.' (updated, user, host, operation, tab, rowkey, col, oldval, newval)' |
.' VALUES (NOW(), "%s", "%s", "delete", "%s", "%s", "%s", "%s", "")', |
$this->logtable, addslashes($this->get_server_var('REMOTE_USER')), |
addslashes($this->get_server_var('REMOTE_ADDR')), addslashes($this->tb), |
addslashes($this->rec), addslashes($key), addslashes(serialize($oldvals))); |
$this->myquery($query, __LINE__); |
} |
// After trigger |
if ($this->exec_triggers('delete', 'after', $oldvals, $changed, $newvals) == false) { |
return false; |
} |
return true; |
} /* }}} */ |
function email_notify($old_vals, $new_vals) /* {{{ */ |
{ |
if (! function_exists('mail')) { |
return false; |
} |
if ($old_vals != false && $new_vals != false) { |
$action = 'update'; |
$subject = 'Record updated in'; |
$body = 'An item with '.$this->fdd[$this->key]['name'].' = ' |
.$this->key_delim.$this->rec.$this->key_delim .' was updated in'; |
$vals = $new_vals; |
} elseif ($new_vals != false) { |
$action = 'insert'; |
$subject = 'Record added to'; |
$body = 'A new item was added into'; |
$vals = $new_vals; |
} elseif ($old_vals != false) { |
$action = 'delete'; |
$subject = 'Record deleted from'; |
$body = 'An item was deleted from'; |
$vals = $old_vals; |
} else { |
return false; |
} |
$addr = $this->get_server_var('REMOTE_ADDR'); |
$user = $this->get_server_var('REMOTE_USER'); |
$body = 'This notification e-mail was automatically generated by phpMyEdit.'."\n\n".$body; |
$body .= ' table '.$this->tb.' in MySQL database '.$this->db.' on '.$this->page_name; |
$body .= ' by '.($user == '' ? 'unknown user' : "user $user").' from '.$addr; |
$body .= ' at '.date('d/M/Y H:i').' with the following fields:'."\n\n"; |
$i = 1; |
foreach ($vals as $k => $text) { |
$name = isset($this->fdd[$k]['name~']) |
? $this->fdd[$k]['name~'] : $this->fdd[$k]['name']; |
if ($action == 'update') { |
if ($old_vals[$k] == $new_vals[$k]) { |
continue; |
} |
$body .= sprintf("[%02s] %s (%s)\n WAS: %s\n IS: %s\n", |
$i, $name, $k, $old_vals[$k], $new_vals[$k]); |
} else { |
$body .= sprintf('[%02s] %s (%s): %s'."\n", $i, $name, $k, $text); |
} |
$i++; |
} |
$body .= "\n--\r\n"; // \r is needed for signature separating |
$body .= "phpMyEdit\ninstant MySQL table editor and code generator\n"; |
$body .= "http://platon.sk/projects/phpMyEdit/\n\n"; |
$subject = @$this->notify['prefix'].$subject.' '.$this->dbp.$this->tb; |
$subject = trim($subject); // just for sure |
$wrap_w = intval(@$this->notify['wrap']); |
$wrap_w > 0 || $wrap_w = 72; |
$from = (string) @$this->notify['from']; |
$from != '' || $from = 'webmaster@'.strtolower($this->get_server_var('SERVER_NAME')); |
$headers = 'From: '.$from."\n".'X-Mailer: PHP/'.phpversion().' (phpMyEdit)'; |
$body = wordwrap($body, $wrap_w, "\n", 1); |
$emails = (array) $this->notify[$action] + (array) $this->notify['all']; |
foreach ($emails as $email) { |
if (! empty($email)) { |
mail(trim($email), $subject, $body, $headers); |
} |
} |
return true; |
} /* }}} */ |
/* |
* Apply triggers function |
* Run a (set of) trigger(s). $trigger can be an Array or a filename |
* Break and return false as soon as a trigger return false |
* we need a reference on $newvals to be able to change value before insert/update |
*/ |
function exec_triggers($op, $step, $oldvals, &$changed, &$newvals) /* {{{ */ |
{ |
if (! isset($this->triggers[$op][$step])) { |
return true; |
} |
$ret = true; |
$trig = $this->triggers[$op][$step]; |
if (is_array($trig)) { |
ksort($trig); |
for ($t = reset($trig); $t !== false && $ret != false; $t = next($trig)) { |
$ret = include($t); |
} |
} else { |
$ret = include($trig); |
} |
return $ret; |
} /* }}} */ |
function exec_triggers_simple($op, $step) /* {{{ */ |
{ |
$oldvals = $newvals = $changed = array(); |
return $this->exec_triggers($op, $step, $oldvals, $changed, $newvals); |
} /* }}} */ |
/* |
* Recreate functions |
*/ |
function recreate_fdd($default_page_type = 'L') /* {{{ */ |
{ |
// TODO: one level deeper browsing |
$this->page_type = $default_page_type; |
$this->filter_operation() && $this->page_type = 'F'; |
$this->view_operation() && $this->page_type = 'V'; |
if ($this->add_operation() |
|| $this->saveadd == $this->labels['Save'] |
|| $this->moreadd == $this->labels['More']) { |
$this->page_type = 'A'; |
} |
if ($this->change_operation() |
|| $this->savechange == $this->labels['Save'] |
|| $this->morechange == $this->labels['Apply']) { |
$this->page_type = 'C'; |
} |
if ($this->copy_operation() || $this->savecopy == $this->labels['Save']) { |
$this->page_type = 'P'; |
} |
if ($this->delete_operation() || $this->savedelete == $this->labels['Delete']) { |
$this->page_type = 'D'; |
} |
// Restore backups (if exists) |
foreach (array_keys($this->fdd) as $column) { |
foreach (array_keys($this->fdd[$column]) as $col_option) { |
if ($col_option[strlen($col_option) - 1] != '~') |
continue; |
$this->fdd[$column][substr($col_option, 0, strlen($col_option) - 1)] |
= $this->fdd[$column][$col_option]; |
unset($this->fdd[$column][$col_option]); |
} |
} |
foreach (array_keys($this->fdd) as $column) { |
foreach (array_keys($this->fdd[$column]) as $col_option) { |
if (! strchr($col_option, '|')) { |
continue; |
} |
$col_ar = explode('|', $col_option, 2); |
if (! stristr($col_ar[1], $this->page_type)) { |
continue; |
} |
// Make field backups |
$this->fdd[$column][$col_ar[0] .'~'] = $this->fdd[$column][$col_ar[0]]; |
$this->fdd[$column][$col_option.'~'] = $this->fdd[$column][$col_option]; |
// Set particular field |
$this->fdd[$column][$col_ar[0]] = $this->fdd[$column][$col_option]; |
unset($this->fdd[$column][$col_option]); |
} |
} |
} /* }}} */ |
function recreate_displayed() /* {{{ */ |
{ |
$field_num = 0; |
$num_fields_displayed = 0; |
$this->fds = array(); |
$this->fdn = array(); |
$this->displayed = array(); |
$this->guidance = false; |
foreach (array_keys($this->fdd) as $key) { |
if (preg_match('/^\d+$/', $key)) { // skipping numeric keys |
continue; |
} |
$this->fds[$field_num] = $key; |
$this->fdn[$key] = $field_num; |
/* We must use here displayed() function, because displayed[] array |
is not created yet. We will simultaneously create that array as well. */ |
if ($this->displayed[$field_num] = $this->displayed($field_num)) { |
$num_fields_displayed++; |
} |
if (is_array(@$this->fdd[$key]['values']) && ! isset($this->fdd[$key]['values']['table'])) { |
foreach ($this->fdd[$key]['values'] as $val) { |
$this->fdd[$key]['values2'][$val] = $val; |
} |
unset($this->fdd[$key]['values']); |
} |
isset($this->fdd[$key]['help']) && $this->guidance = true; |
$this->fdd[$field_num] = $this->fdd[$key]; |
$field_num++; |
} |
$this->num_fds = $field_num; |
$this->num_fields_displayed = $num_fields_displayed; |
$this->key_num = array_search($this->key, $this->fds); |
/* Adds first displayed column into sorting fields by replacing last |
array entry. Also remove duplicite values and change column names to |
their particular field numbers. |
Note that entries like [0]=>'9' [1]=>'-9' are correct and they will |
have desirable sorting behaviour. So there is no need to remove them. |
*/ |
$this->sfn = array_unique($this->sfn); |
$check_ar = array(); |
foreach ($this->sfn as $key => $val) { |
if (preg_match('/^[-]?\d+$/', $val)) { // skipping numeric keys |
$val = abs($val); |
if (in_array($val, $check_ar) || $this->password($val)) { |
unset($this->sfn[$key]); |
} else { |
$check_ar[] = $val; |
} |
continue; |
} |
if ($val[0] == '-') { |
$val = substr($val, 1); |
$minus = '-'; |
} else { |
$minus = ''; |
} |
if (($val = array_search($val, $this->fds)) === false || $this->password($val)) { |
unset($this->sfn[$key]); |
} else { |
$val = intval($val); |
if (in_array($val, $check_ar)) { |
unset($this->sfn[$key]); |
} else { |
$this->sfn[$key] = $minus.$val; |
$check_ar[] = $val; |
} |
} |
} |
$this->sfn = array_unique($this->sfn); |
return true; |
} /* }}} */ |
function backward_compatibility() /* {{{ */ |
{ |
foreach (array_keys($this->fdd) as $column) { |
// move ['required'] to ['js']['required'] |
if (! isset($this->fdd[$column]['js']['required']) && isset($this->fdd[$column]['required'])) { |
$this->fdd[$column]['js']['required'] = $this->fdd[$column]['required']; |
} |
// move 'HWR' flags from ['options'] into ['input'] |
if (isset($this->fdd[$column]['options'])) { |
stristr($this->fdd[$column]['options'], 'H') && $this->fdd[$column]['input'] .= 'H'; |
stristr($this->fdd[$column]['options'], 'W') && $this->fdd[$column]['input'] .= 'W'; |
stristr($this->fdd[$column]['options'], 'R') && $this->fdd[$column]['input'] .= 'R'; |
} |
} |
} /* }}} */ |
/* |
* Error handling function |
*/ |
function error($message, $additional_info = '') /* {{{ */ |
{ |
echo '<h1>phpMyEdit error: ',htmlspecialchars($message),'</h1>',"\n"; |
if ($additional_info != '') { |
echo '<hr />',htmlspecialchars($additional_info); |
} |
return false; |
} /* }}} */ |
/* |
* Database connection function |
*/ |
function connect() /* {{{ */ |
{ |
if (isset($this->dbh)) { |
return true; |
} |
if (!isset($this->db)) { |
$this->error('no database defined'); |
return false; |
} |
if (!isset ($this->tb)) { |
$this->error('no table defined'); |
return false; |
} |
$this->dbh = @ini_get('allow_persistent') |
? @mysql_pconnect($this->hn, $this->un, $this->pw) |
: @mysql_connect($this->hn, $this->un, $this->pw); |
if (!$this->dbh) { |
$this->error('could not connect to MySQL'); |
return false; |
} |
return true; |
} /* }}} */ |
/* |
* Database disconnection function |
*/ |
function disconnect() /* {{{ */ |
{ |
if ($this->close_dbh) { |
@mysql_close($this->dbh); |
$this->dbh = null; |
} |
} /* }}} */ |
/* |
* The workhorse |
*/ |
function execute() /* {{{ */ |
{ |
// DEBUG - uncomment to enable |
/* |
//phpinfo(); |
$this->print_get_vars(); |
$this->print_post_vars(); |
$this->print_vars(); |
echo "<pre>query opts:\n"; |
echo print_r($this->query_opts); |
echo "</pre>\n"; |
echo "<pre>get vars:\n"; |
echo print_r($this->get_opts); |
echo "</pre>\n"; |
*/ |
// Let's do explicit quoting - it's safer |
set_magic_quotes_runtime(0); |
// Checking if language file inclusion was successful |
if (! is_array($this->labels)) { |
$this->error('could not locate language files', 'searched path: '.$this->dir['lang']); |
return false; |
} |
// Database connection |
if ($this->connect() == false) { |
return false; |
} |
/* |
* ====================================================================== |
* Pass 3: process any updates generated if the user has selected |
* a save or cancel button during Pass 2 |
* ====================================================================== |
*/ |
// Cancel button - Cancel Triggers |
if ($this->add_canceled() || $this->copy_canceled()) { |
$this->exec_triggers_simple('insert', 'cancel'); |
} |
if ($this->view_canceled()) { |
$this->exec_triggers_simple('select', 'cancel'); |
} |
if ($this->change_canceled()) { |
$this->exec_triggers_simple('update', 'cancel'); |
} |
if ($this->delete_canceled()) { |
$this->exec_triggers_simple('delete', 'cancel'); |
} |
// Save/More Button - database operations |
if ($this->saveadd == $this->labels['Save'] || $this->savecopy == $this->labels['Save']) { |
$this->add_enabled() && $this->do_add_record(); |
unset($this->saveadd); |
unset($this->savecopy); |
$this->recreate_fdd(); |
} |
elseif ($this->moreadd == $this->labels['More']) { |
$this->add_enabled() && $this->do_add_record(); |
$this->operation = $this->labels['Add']; // to force add operation |
$this->recreate_fdd(); |
$this->recreate_displayed(); |
$this->backward_compatibility(); |
} |
elseif ($this->savechange == $this->labels['Save']) { |
$this->change_enabled() && $this->do_change_record(); |
unset($this->savechange); |
$this->recreate_fdd(); |
} |
elseif ($this->morechange == $this->labels['Apply']) { |
$this->change_enabled() && $this->do_change_record(); |
$this->operation = $this->labels['Change']; // to force change operation |
$this->recreate_fdd(); |
$this->recreate_displayed(); |
$this->backward_compatibility(); |
} |
elseif ($this->savedelete == $this->labels['Delete']) { |
$this->delete_enabled() && $this->do_delete_record(); |
unset($this->savedelete); |
$this->recreate_fdd(); |
} |
/* |
* ====================================================================== |
* Pass 2: display an input/edit/confirmation screen if the user has |
* selected an editing button on Pass 1 through this page |
* ====================================================================== |
*/ |
if ($this->add_operation() |
|| $this->change_operation() || $this->delete_operation() |
|| $this->view_operation() || $this->copy_operation()) { |
$this->display_record(); |
} |
/* |
* ====================================================================== |
* Pass 1 and Pass 3: display the MySQL table in a scrolling window on |
* the screen (skip this step in 'Add More' mode) |
* ====================================================================== |
*/ |
else { |
$this->list_table(); |
} |
$this->disconnect(); |
if ($this->display['time'] && $this->timer != null) { |
echo $this->timer->end(),' miliseconds'; |
} |
} /* }}} */ |
/* |
* Class constructor |
*/ |
function phpMyEdit($opts) /* {{{ */ |
{ |
// Set desirable error reporting level |
$error_reporting = error_reporting(E_ALL & ~E_NOTICE); |
// Database handle variables |
if (isset($opts['dbh'])) { |
$this->close_dbh = false; |
$this->dbh = $opts['dbh']; |
$this->dbp = ''; |
} else { |
$this->close_dbh = true; |
$this->dbh = null; |
$this->dbp = $opts['db'].'.'; |
$this->hn = $opts['hn']; |
$this->un = $opts['un']; |
$this->pw = $opts['pw']; |
$this->db = $opts['db']; |
} |
$this->tb = $opts['tb']; |
// Other variables |
$this->key = $opts['key']; |
$this->key_type = $opts['key_type']; |
$this->inc = $opts['inc']; |
$this->options = $opts['options']; |
$this->fdd = $opts['fdd']; |
$this->multiple = intval($opts['multiple']); |
$this->multiple <= 0 && $this->multiple = 2; |
$this->filters = @$opts['filters']; |
$this->triggers = @$opts['triggers']; |
$this->notify = @$opts['notify']; |
$this->logtable = @$opts['logtable']; |
$this->page_name = @$opts['page_name']; |
if (! isset($this->page_name)) { |
$this->page_name = basename($this->get_server_var('PHP_SELF')); |
isset($this->page_name) || $this->page_name = $this->tb; |
} |
$this->display['query'] = @$opts['display']['query']; |
$this->display['sort'] = @$opts['display']['sort']; |
$this->display['time'] = @$opts['display']['time']; |
if ($this->display['time']) { |
$this->timer = new phpMyEdit_timer(); |
} |
$this->display['tabs'] = isset($opts['display']['tabs']) |
? $opts['display']['tabs'] : true; |
$this->display['form'] = isset($opts['display']['form']) |
? $opts['display']['form'] : true; |
$this->display['num_records'] = isset($opts['display']['num_records']) |
? $opts['display']['num_records'] : true; |
$this->display['num_pages'] = isset($opts['display']['num_pages']) |
? $opts['display']['num_pages'] : true; |
// Creating directory variables |
$this->dir['root'] = dirname(realpath(__FILE__)) |
. (strlen(dirname(realpath(__FILE__))) > 0 ? '/' : ''); |
$this->dir['lang'] = $this->dir['root'].'lang/'; |
// Creating URL variables |
$this->url['images'] = 'images/'; |
isset($opts['url']['images']) && $this->url['images'] = $opts['url']['images']; |
// CSS classes policy |
$this->css = @$opts['css']; |
!isset($this->css['separator']) && $this->css['separator'] = '-'; |
!isset($this->css['prefix']) && $this->css['prefix'] = 'pme'; |
!isset($this->css['page_type']) && $this->css['page_type'] = false; |
!isset($this->css['position']) && $this->css['position'] = false; |
!isset($this->css['divider']) && $this->css['divider'] = 2; |
$this->css['divider'] = intval(@$this->css['divider']); |
// JS overall configuration |
$this->js = @$opts['js']; |
!isset($this->js['prefix']) && $this->js['prefix'] = 'PME_js_'; |
// DHTML overall configuration |
$this->dhtml = @$opts['dhtml']; |
!isset($this->dhtml['prefix']) && $this->dhtml['prefix'] = 'PME_dhtml_'; |
// Navigation |
$this->navigation = @$opts['navigation']; |
if (! $this->nav_buttons() && ! $this->nav_text_links() && ! $this->nav_graphic_links()) { |
$this->navigation .= 'B'; // buttons are default |
} |
if (! $this->nav_up() && ! $this->nav_down()) { |
$this->navigation .= 'D'; // down position is default |
} |
$this->buttons = $opts['buttons']; |
// Language labels (must go after navigation) |
$this->labels = $this->make_language_labels(isset($opts['language']) |
? $opts['language'] : $this->get_server_var('HTTP_ACCEPT_LANGUAGE')); |
// CGI variables |
$this->cgi = @$opts['cgi']; |
$this->cgi['persist'] = ''; |
if (@is_array($opts['cgi']['persist'])) { |
foreach ($opts['cgi']['persist'] as $key => $val) { |
if (is_array($val)) { |
foreach($val as $key2 => $val2) { |
$this->cgi['persist'] .= '&'.rawurlencode($key) |
.'['.rawurlencode($key2).']='.rawurlencode($val2); |
} |
} else { |
$this->cgi['persist'] .= '&'.rawurlencode($key).'='.rawurlencode($val); |
} |
} |
} |
foreach (array('operation', 'sys', 'data') as $type) { |
if (! isset($this->cgi['prefix'][$type])) { |
$this->cgi['prefix'][$type] = $this->get_default_cgi_prefix($type); |
} |
} |
// Sorting variables |
$this->sfn = $this->get_sys_cgi_var('sfn'); |
isset($this->sfn) || $this->sfn = array(); |
is_array($this->sfn) || $this->sfn = array($this->sfn); |
isset($opts['sort_field']) || $opts['sort_field'] = array(); |
is_array($opts['sort_field']) || $opts['sort_field'] = array($opts['sort_field']); |
$this->sfn = array_merge($this->sfn, $opts['sort_field']); |
// Form variables all around |
$this->fl = intval($this->get_sys_cgi_var('fl')); |
$this->fm = intval($this->get_sys_cgi_var('fm')); |
// $old_page = ceil($this->fm / abs($this->inc)) + 1; |
$this->qfn = $this->get_sys_cgi_var('qfn'); |
$this->sw = $this->get_sys_cgi_var('sw'); |
$this->rec = $this->get_sys_cgi_var('rec', ''); |
$this->navop = $this->get_sys_cgi_var('navop'); |
$navfmup = $this->get_sys_cgi_var('navfmup'); |
$navfmdown = $this->get_sys_cgi_var('navfmdown'); |
$navpnup = $this->get_sys_cgi_var('navpnup'); |
$navpndown = $this->get_sys_cgi_var('navpndown'); |
if($navfmdown!=NULL && $navfmdown != $this->fm) $this->navfm = $navfmdown; |
elseif($navfmup!=NULL && $navfmup != $this->fm) $this->navfm = $navfmup; |
elseif($navpndown!=NULL && ($navpndown-1)*$this->inc != $this->fm) $this->navfm = ($navpndown-1)*$this->inc; |
elseif($navpnup!=NULL && ($navpnup-1)*$this->inc != $this->fm) $this->navfm = ($navpnup-1)*$this->inc; |
else $this->navfm = $this->fm; |
$this->operation = $this->get_sys_cgi_var('operation'); |
$oper_prefix_len = strlen($this->cgi['prefix']['operation']); |
if (! strncmp($this->cgi['prefix']['operation'], $this->operation, $oper_prefix_len)) { |
$this->operation = $this->labels[substr($this->operation, $oper_prefix_len)]; |
} |
$this->saveadd = $this->get_sys_cgi_var('saveadd'); |
$this->moreadd = $this->get_sys_cgi_var('moreadd'); |
$this->canceladd = $this->get_sys_cgi_var('canceladd'); |
$this->savechange = $this->get_sys_cgi_var('savechange'); |
$this->morechange = $this->get_sys_cgi_var('morechange'); |
$this->cancelchange = $this->get_sys_cgi_var('cancelchange'); |
$this->savecopy = $this->get_sys_cgi_var('savecopy'); |
$this->cancelcopy = $this->get_sys_cgi_var('cancelcopy'); |
$this->savedelete = $this->get_sys_cgi_var('savedelete'); |
$this->canceldelete = $this->get_sys_cgi_var('canceldelete'); |
$this->cancelview = $this->get_sys_cgi_var('cancelview'); |
// Filter setting |
if (isset($this->sw)) { |
$this->sw == $this->labels['Search'] && $this->fl = 1; |
$this->sw == $this->labels['Hide'] && $this->fl = 0; |
//$this->sw == $this->labels['Clear'] && $this->fl = 0; |
} |
// TAB names |
$this->tabs = array(); |
// Setting key_delim according to key_type |
if ($this->key_type == 'real') { |
/* If 'real' key_type does not work, |
try change MySQL datatype from float to double */ |
$this->rec = doubleval($this->rec); |
$this->key_delim = ''; |
} elseif ($this->key_type == 'int') { |
$this->rec = intval($this->rec); |
$this->key_delim = ''; |
} else { |
$this->key_delim = '"'; |
// $this->rec remains unmodified |
} |
// Specific $fdd modifications depending on performed action |
$this->recreate_fdd(); |
// Extract SQL Field Names and number of fields |
$this->recreate_displayed(); |
// Issue backward compatibility |
$this->backward_compatibility(); |
// Gathering query options |
$this->gather_query_opts(); |
// Call to action |
!isset($opts['execute']) && $opts['execute'] = 1; |
$opts['execute'] && $this->execute(); |
// Restore original error reporting level |
error_reporting($error_reporting); |
} /* }}} */ |
} |
/* Modeline for ViM {{{ |
* vim:set ts=4: |
* vim600:fdm=marker fdl=0 fdc=0: |
* }}} */ |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-report.class.php |
---|
New file |
0,0 → 1,319 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-report.class.php - phpMyEdit report extension |
* ____________________________________________________________ |
* |
* Developed by Ondrej Jombik <nepto@platon.sk> |
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-report.class.php,v 1.12 2006-01-22 21:44:23 nepto Exp $ */ |
/* Extension TODO: |
- allow user to enable/disable particular field in reporting (maybe 'X' flag |
for indicating that field is forbidden is good idea) |
- support for ['help'] in select fields screen |
- make extension's option for selecting "Select fields" link or button |
*/ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_report extends phpMyEdit |
{ |
function phpMyEdit_report($opts) /* {{{ */ |
{ |
$opts['options'] = 'L'; |
$execute = 1; |
isset($opts['execute']) && $execute = $opts['execute']; |
$opts['execute'] = 0; |
parent::phpMyEdit($opts); |
$execute && $this->execute(); |
} /* }}} */ |
function make_language_labels($language) /* {{{ */ |
{ |
$ret = parent::make_language_labels($language); |
strlen($ret['Make report']) <= 0 && $ret['Make report'] = 'Make report'; |
strlen($ret['Select fields']) <= 0 && $ret['Select fields'] = 'Select fields'; |
strlen($ret['Records per screen']) <= 0 && $ret['Records per screen'] = 'Records per screen'; |
return $ret; |
} /* }}} */ |
function get_cgi_cookie_var($name, $default_value = null) /* {{{ */ |
{ |
$ret = $this->get_cgi_var($name, null); |
if ($ret === null) { |
global $HTTP_COOKIE_VARS; |
$ret = @$HTTP_COOKIE_VARS[$name.'_'.$this->tb.'_cookie']; |
if (! isset($ret)) { |
$ret = $default_value; |
} |
} |
return $ret; |
} /* }}} */ |
function display_list_table_buttons($total_recs, $position) /* {{{ */ |
{ /* This is mostly copy/paste from core class. */ |
$listall = $this->inc <= 0; // Are we doing a listall? |
echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
echo '<input class="',$this->getCSSclass('fields-select', $position); |
echo '" type="submit" name="fields_select" value="',$this->labels['Select fields'],'"> '; |
// Note that <input disabled isn't valid HTML, but most browsers support it |
$disabled = ($this->fm > 0 && ! $listall) ? '' : ' disabled'; |
echo '<input',$disabled,' class="',$this->getCSSclass('prev', $position); |
echo '" type="submit" name="',ltrim($disabled),'prev" value="',$this->labels['Prev'],'"> '; |
$disabled = ($this->fm + $this->inc < $total_recs && ! $listall) ? '' : ' disabled'; |
echo '<input',$disabled,' class="',$this->getCSSclass('next', $position); |
echo '" type="submit" name="',ltrim($disabled),'next" value="',$this->labels['Next'],'">'; |
// Message is now written here |
echo '</td>',"\n"; |
if (strlen(@$this->message) > 0) { |
echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n"; |
} |
// Display page and records statistics |
echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n"; |
if ($listall) { |
echo $this->labels['Page'],': 1 ',$this->labels['of'],' 1'; |
} else { |
echo $this->labels['Page'],': ',($this->fm / $this->inc) + 1; |
echo ' ',$this->labels['of'],' ',max(1, ceil($total_recs / abs($this->inc))); |
} |
echo ' ',$this->labels['Records'],': ',$total_recs; |
echo '</td></tr></table>',"\n"; |
} /* }}} */ |
function display_report_selection_buttons($position) /* {{{ */ |
{ |
echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
echo '<input class="',$this->getCSSclass('make-report', $position); |
echo '" type="submit" name="prepare_filter" value="',$this->labels['Make report'],'">',"\n"; |
echo '</td></tr></table>',"\n"; |
} /* }}} */ |
function get_select_fields_link() /* {{{ */ |
{ |
$link = '<a href="'.htmlspecialchars($this->page_name).'?fields_select=1'; |
for ($i = 0; $i < count($table_cols); $i++) { |
$varname = 'qf'.$i; |
$value = $this->get_cgi_cookie_var($varname); |
if (! empty($value)) { |
$link .= htmlspecialchars( |
'&'.rawurlencode($varname). |
'='.rawurlencode($value)); |
} |
} |
$link .= htmlspecialchars($this->cgi['persist']); |
$link .= '">'.$this->labels['Select fields'].'</a>'; |
return $link; |
} /* }}} */ |
function execute() /* {{{ */ |
{ |
global $HTTP_GET_VARS; |
global $HTTP_POST_VARS; |
/* |
* Extracting field names |
*/ |
$table_cols = array(); |
$all_table_cols = array(); |
if ($this->connect() == false) { |
return false; |
} |
$query_parts = array( |
'type' => 'select', |
'select' => '*', |
'from' => $this->tb, |
'limit' => '1'); |
$result = $this->myquery($this->get_SQL_query($query_parts), __LINE__); |
$all_table_cols = array_keys(@mysql_fetch_array($result, MYSQL_ASSOC)); |
if (count($all_table_cols) <= 0) { |
$this->error('database fetch error'); |
return false; |
} |
foreach (array_keys($this->fdd) as $field_name) { |
if (preg_match('/^\d*$/', $field_name)) |
continue; |
if (($idx = array_search($field_name, $all_table_cols)) !== false) |
$table_cols[$field_name] = mysql_field_len($result, $idx); |
} |
@mysql_free_result($result); |
unset($all_table_cols); |
/* |
* Preparing variables |
*/ |
$fields_select = $this->get_cgi_var('fields_select'); |
$filter = $this->get_cgi_var('filter'); |
$prepare_filter = $this->get_cgi_var('prepare_filter'); |
$this->inc = intval($this->get_cgi_cookie_var('inc')); |
$force_select = true; |
$none_displayed = true; |
$expire_time = time() + (3600 * 24 * 30 * 12 * 5); // five years |
$headers_sent = @headers_sent(); |
foreach (array_merge(array('@inc'), array_keys($table_cols)) as $col) { |
$varname = ($col[0] == '@' ? substr($col, 1) : 'have_'.$col); |
if (isset($HTTP_POST_VARS[$varname]) || isset($HTTP_GET_VARS[$varname])) { |
$value = $HTTP_POST_VARS[$varname]; |
if (isset($HTTP_GET_VARS[$varname])) { |
$value = $HTTP_GET_VARS[$varname]; |
} |
if ($varname != 'inc' && ! empty($value)) { |
$force_select = false; |
} |
$headers_sent || setcookie($varname.'_'.$this->tb.'_cookie', $value, $expire_time); |
$this->cgi['persist'] .= '&'.urlencode($varname); |
$this->cgi['persist'] .= '='.urlencode($value); |
} else { |
$headers_sent || setcookie($varname.'_'.$this->tb.'_cookie', '', time() - 10000); |
} |
} |
$i = -1; |
foreach (array_keys($this->fdd) as $key) { |
$i++; |
if (preg_match('/^\d*$/', $key)) |
continue; |
$varname = 'have_'.$key; |
$value = @$this->get_cgi_cookie_var($varname, ''); |
$options = @$value ? 'LV' : ''; |
$this->fdd[$i]['options'] = $options; |
$this->fdd[$key]['options'] = $options; |
$this->displayed[$i] = @$value ? true : false; |
$value && $none_displayed = false; |
} |
/* |
* Redirecting when neccessary |
* (hackity hack with unregistering/unchecking fields) |
*/ |
if ($prepare_filter && ! $headers_sent) { |
$this->execute_redirect(); |
exit; |
} |
/* |
* Check if field selection report screen has to be displayed |
*/ |
if (isset($fields_select) || $force_select || $none_displayed) { |
$this->execute_report_screen($table_cols); |
return true; |
} |
if (0) { |
$this->message .= $this->get_select_fields_link(); |
} |
// parent class call |
return parent::execute(); |
} /* }}} */ |
function execute_redirect() /* {{{ */ |
{ |
global $HTTP_SERVER_VARS; |
global $HTTP_GET_VARS; |
global $HTTP_POST_VARS; |
$redirect_url = 'http://'.$HTTP_SERVER_VARS['HTTP_HOST'].$HTTP_SERVER_VARS['SCRIPT_NAME']; |
$delim = '?'; |
foreach ($HTTP_POST_VARS + $HTTP_GET_VARS as $cgi_var_name => $cgi_var_value) { |
$cgi_var_name == 'prepare_filter' && $cgi_var_name = 'filter'; |
$redirect_url .= $delim; |
$redirect_url .= rawurlencode($cgi_var_name).'='.rawurlencode($cgi_var_value); |
$delim == '?' && $delim = '&'; |
} |
$redirect_url .= $this->cgi['persist']; |
header('Location: '.$redirect_url); |
exit; |
} /* }}} */ |
function execute_report_screen($table_cols) /* {{{ */ |
{ |
echo '<form class="',$this->getCSSclass('form'),'" action="'; |
echo htmlspecialchars($this->page_name),'" method="POST">',"\n"; |
if ($this->nav_up()) { |
$this->display_report_selection_buttons('up'); |
echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n"; |
} |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
$i = 0; |
foreach ($table_cols as $key => $val) { |
$css_postfix = @$this->fdd[$key]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
$varname = 'have_'.$key; |
$value = $this->get_cgi_cookie_var($varname); |
$checked = @$value ? ' checked' : ''; |
echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">'; |
echo $this->fdd[$i]['name'],'</td>',"\n"; |
echo '<td class="',$this->getCSSclass('check', null, true, $css_postfix),'">'; |
echo '<input class="',$css_class_name,'" type="checkbox" name="'; |
echo htmlspecialchars($varname),'"',$checked,'>'; |
echo '</td>',"\n"; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($key),">\n"; |
$varname = 'qf'.$i; |
$value = $this->get_cgi_cookie_var($varname); |
if ($this->fdd[$key]['select'] == 'D' || $this->fdd[$key]['select'] == 'M') { |
$from_table = ! $this->col_has_values($key) || isset($this->fdd[$key]['values']['table']); |
$selected = $value; |
$value = $this->set_values($key, array('*' => '*'), null, $from_table); |
$multiple = $this->col_has_multiple_select($key); |
$multiple |= $this->fdd[$key]['select'] == 'M'; |
$readonly = false; |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($varname.'_id', $css_class_name, $value, $selected, |
$multiple, $readonly, $strip_tags, $escape); |
} else { |
echo '<input class="',$css_class_name,'" type=text name="'; |
echo htmlspecialchars($varname),'" value="',htmlspecialchars($value),'" size="'; |
echo min(40, $val),'" maxlength="',min(40, max(10, $val)),'">'; |
} |
echo '</td>',"\n",'</tr>',"\n"; |
$i++; |
} |
echo '<tr class="',$this->getCSSclass('row', null, 'next', $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'" colspan="2">'; |
echo $this->labels['Records per screen'],'</td>'; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'">'; |
echo '<input class="',$css_class_name,'" type="text" name="inc" value="',$this->inc.'">'; |
echo '</td></tr>',"\n"; |
echo '</table>',"\n"; |
if ($this->nav_down()) { |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
$this->display_report_selection_buttons('down'); |
} |
echo '</form>'; |
} /* }}} */ |
} |
/* Modeline for ViM {{{ |
* vim:set ts=4: |
* vim600:fdm=marker fdl=0 fdc=0: |
* }}} */ |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-htmlarea.class.php |
---|
New file |
0,0 → 1,209 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-htmlarea.class.php - phpMyEdit htmlArea extension |
* ____________________________________________________________ |
* |
* Contribution of Ezudin Kurtowich <ekurtovic@ieee.org>, Sarajevo |
* Copyright (c) 2003-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-htmlarea.class.php,v 1.10 2006-01-22 21:44:18 nepto Exp $ */ |
/* |
OVERVIEW |
-------- |
NOTE...This extension will not work with the CVS version of PME. It has |
been replaced by the mce_cal extension. |
htmlArea is a free WYSIWYG textarea replacement from |
http://www.interactivetools.com/ website. |
REQUIREMENTS |
------------ |
The extension requires a properly installed htmlArea script |
as described on the http://www.interactivetools.com/ site. |
USAGE |
----- |
This extension enables WYSIWYG editing of a textarea field. |
In order to use it, you should: |
1. Load htmlArea script in the <head>...</head> section of your |
phpMyEdit calling program as described in the htmlarea manual. |
NOTE: To avoid an unwanted side effect in css style produced |
by phpMyEditSetup.php, delete 'table-width:100%' property. |
2. Call to phpMyEdit-htmlarea.class.php instead |
of phpMyEdit.class.php. |
Example: |
require_once 'extensions/phpMyEdit-htmlarea.class.php'; |
new phpMyEdit_htmlarea($opts); |
3. Add 'html'=>true parameter to the textarea field definition |
in your phpMyEdit calling program. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'textarea' => array( |
'html' => true, |
'rows' => 11, |
'cols' => 81) |
); |
SEARCH KEYWORD |
-------------- |
Search for "htmlArea" string in this source code, |
to find all extension related modifications. |
*/ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_htmlarea extends phpMyEdit |
{ |
/* |
* Display functions overriding |
*/ |
function display_add_record() /* {{{ */ |
{ |
for ($k = 0; $k < $this->num_fds; $k++) { |
if ($this->hidden($k)) { |
echo $this->htmlHidden($this->fds[$k], $row["qf$k"]); |
continue; |
} |
if (! $this->displayed[$k]) { |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix); |
echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">',$this->fdd[$k]['name'],'</td>',"\n"; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'">'."\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$selected = @$this->fdd[$k]['default']; |
$multiple = $this->fdd[$k]['select'] == 'M' && ! $this->fdd[$k]['values']['table']; |
$readonly = $this->readonly($k); |
echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $selected, $multiple,$readonly); |
} elseif (isset ($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="'.$this->fds[$k].'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>',htmlspecialchars($this->fdd[$k]['default']),'</textarea>',"\n"; |
// EK htmlArea code modification is here |
if (isset($this->fdd[$k]['textarea']['html'])) { |
echo '<script type="text/javascript" language="javascript1.2"><!--',"\n"; |
echo 'editor_generate("',$this->fds[$k],'");',"\n"; |
echo '// --></script>'; |
} |
} else { |
// Simple edit box required |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
//$maxlen > 0 || $maxlen = 300; |
$size = min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"'; |
echo $size_ml_props,' value="'; |
echo htmlspecialchars($this->fdd[$k]['default']),'">'; |
} |
echo '</td>',"\n"; |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} /* }}} */ |
function display_change_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'">',"\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$multiple = $this->fdd[$k]['select'] == 'M' && ! $this->fdd[$k]['values']['table']; |
$readonly = $this->readonly($k); |
echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $row["qf$k"], $multiple, $readonly); |
} elseif (isset($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="'.$this->fds[$k].'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>',htmlspecialchars($row["qf$k"]),'</textarea>',"\n"; |
// EK htmlArea code modification is here |
if (isset($this->fdd[$k]['textarea']['html'])) { |
echo '<script type="text/javascript" language="javascript1.2"><!--',"\n"; |
echo 'editor_generate("',$this->fds[$k],'");',"\n"; |
echo '// --></script>'; |
} |
} else { |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
//$maxlen > 0 || $maxlen = 300; |
$size = min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="'; |
echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n"; |
} |
echo '</td>',"\n"; |
} /* }}} */ |
} |
/* Modeline for ViM {{{ |
* vim:set ts=4: |
* vim600:fdm=marker fdl=0 fdc=0: |
* }}} */ |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-slide.class.php |
---|
New file |
0,0 → 1,144 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-slide.class.php - slide show extension for phpMyEdit |
* ____________________________________________________________ |
* |
* Developed by Ondrej Jombik <nepto@platon.sk> |
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-slide.class.php,v 1.10 2006-01-22 21:44:24 nepto Exp $ */ |
/* |
* Coding elapsed time: from 8:30 to 10:30 at 30th October 2002 |
* with heavy patching phpMyEdit core class. |
* |
* Music used: E-Type (Campione, This is the Way and others) |
*/ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_slide extends phpMyEdit |
{ |
// Extension options array |
var $ext; |
function phpMyEdit_slide($opts) /* {{{ */ |
{ |
$execute = 1; |
isset($opts['execute']) && $execute = $opts['execute']; |
$opts['execute'] = 0; |
parent::phpMyEdit($opts); |
$this->ext = $opts['ext']; |
$execute && $this->execute($opts); |
} /* }}} */ |
function display_record_buttons() /* {{{ */ |
{ |
// TODO: classify this table and cells |
echo '<table border=0 cellpadding=0 cellspacing=0 width="100%" style="border:0;padding:0;">'; |
echo '<tr><td align=left style="text-align:left;border:0;padding:0;" nowrap>' . "\n"; |
if ($this->change_operation()) { |
echo '<input type="submit" name="savechange" value="'.$this->labels['Save'].'" />'."\n"; |
echo '<input type="submit" name="morechange" value="'.$this->labels['Apply'].'" />'."\n"; |
echo '<input type="button" name="cancel" value="'.$this->labels['Cancel'].'" onClick="form.submit();" />'."\n"; |
echo '<input type="hidden" name="rec_change" value="1">'; |
} elseif ($this->view_operation()) { |
if ($this->change_enabled()) { |
echo '<input type="submit" name="operation" value="'.$this->labels['Change'].'" />'."\n"; |
} |
echo '<input type="submit" name="cancel" value="'.$this->labels['Cancel'].'" />'."\n"; |
} |
if (! $this->ext['prev_disable']) { |
$disabled = $this->ext['prev'] ? '' : ' disabled'; |
echo '<input'.$disabled.' type="submit" name="'.ltrim($disabled).'prev" value="' |
.$this->labels['Prev'].'"> '; |
echo '<input type="hidden" name="rec_prev" value="'.$this->ext['prev'].'">'; |
} |
if (! $this->ext['next_disable']) { |
$disabled = $this->ext['next'] ? '' : ' disabled'; |
echo '<input'.$disabled.' type="submit" name="'.ltrim($disabled).'next" value="' |
.$this->labels['Next'].'">'; |
echo '<input type="hidden" name="rec_next" value="'.$this->ext['next'].'">'; |
} |
echo '</td></tr></table>'."\n"; |
} /* }}} */ |
function execute($opts) /* {{{ */ |
{ |
if ($this->get_cgi_var('rec_change') |
&& ($this->next_operation() || $this->prev_operation())) { |
$this->operation = $this->labels['Change']; |
} |
if (! $this->change_operation()) { |
$this->operation = $this->labels['View']; |
} |
if ($this->prev_operation()) { |
! $this->ext['prev_disabled'] && $this->rec = $this->get_cgi_var('rec_prev'); |
$this->prev = ''; |
} |
if ($this->next_operation()) { |
! $this->ext['next_disabled'] && $this->rec = $this->get_cgi_var('rec_next'); |
$this->next = ''; |
} |
if (! $this->rec) { |
$this->rec = $this->ext['rec']; |
} |
if (! $this->rec |
|| (! $this->ext['prev_disable'] && ! $this->ext['prev']) |
|| (! $this->ext['next_disable'] && ! $this->ext['next'])) { |
if ($this->connect() == false) { |
return false; |
} |
$query_parts = array( |
'type' => 'select', |
// XXX FIXME - simplify query |
'select' => 'PMEtable0.'.$this->key, |
'from' => $this->get_SQL_join_clause(), |
'where' => $this->get_SQL_where_from_query_opts()); |
// TODO: order by clausule according to default sort order options |
$res = $this->myquery($this->get_SQL_query($query_parts), __LINE__); |
$ids = array(); |
while (($row = @mysql_fetch_array($res, MYSQL_NUM)) !== false) { |
$ids[] = $row[0]; |
} |
@mysql_free_result($res); |
if ($this->rec) { |
$idx = array_search($this->rec, $ids); |
$idx === false && $idx = 0; |
} else { |
$idx = 0; |
} |
$this->rec = $ids[$idx]; |
! $this->ext['prev'] && $this->ext['prev'] = $ids[$idx - 1]; |
! $this->ext['next'] && $this->ext['next'] = $ids[$idx + 1]; |
} |
$this->recreate_fdd(); |
$this->recreate_displayed(); |
parent::execute(); |
} /* }}} */ |
} |
/* Modeline for ViM {{{ |
* vim:set ts=4: |
* vim600:fdm=marker fdl=0 fdc=0: |
* }}} */ |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-mce-cal.class.php |
---|
New file |
0,0 → 1,509 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-mce-cal.class.php - phpMyEdit html area & calendar popup extension |
* ____________________________________________________________ |
* |
* Contribution of Adam Hammond <php@pixolet.co.uk>, London, UK |
* Contribution of Ezudin Kurtowich <ekurtovic@ieee.org>, Sarajevo |
* Copyright (c) 2003-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* Updated 28th Jul 2005 |
* |
* Updated to use TinyMCE instead of HTMLArea |
* Updated to handle multiple tabs and to use PME prefixes. |
* Updated to include sub-form patch |
* |
* |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-mce-cal.class.php,v 1.6 2006-09-16 18:43:47 nepto Exp $ */ |
/* |
OVERVIEW |
-------- |
mce_cal extends the standard phpMyEdit class to allow |
a calendar popup helper to be put on any text field and for any textarea |
field to turned into an HTML editor. |
This extension uses the free jsCalendar from http://dynarch.com/mishoo |
and the TinyMCE code from http://tinymce.moxiecode.com/ |
REQUIREMENTS |
------------ |
The requirement is a properly installed jsCalendar and TinyMCE script. |
All browsers supported by these scripts are supported by this |
extension. Note that version 1.44 or later for TinyMCE is required. |
USAGE |
----- |
For both features: |
1. Call to phpMyEdit-mce-cal.class.php instead |
of phpMyEdit.class.php. |
Example: |
require_once 'extensions/phpMyEdit-mce-cal.class.php'; |
new phpMyEdit_mce_cal($opts); |
HTML TextArea |
This enables WYSIWYG editing of a textarea field. |
In order to use it, you should: |
1. Load TinyMCE script in the <head>...</head> section of your |
phpMyEdit calling program as described in the htmlarea manual. |
<!-- tinyMCE --> |
<script language="javascript" type="text/javascript" src="js/<path to TinyMCE>"></script> |
<script language="javascript" type="text/javascript"> |
tinyMCE.init({ |
mode : "specific_textareas", |
auto_reset_designmode : true |
}); |
</script> |
<!-- /tinyMCE --> |
where 'js/<path to TinyMCE>' is the path to the javascript code |
NOTES: |
A. The PME implementation uses the "specific_textareas" mode - this |
must always be set |
B. Due to a bug in Mozilla, if any of the textareas being used as HTML |
editors are in tabs and are initially hidden, the width and height |
need to be specified in the tinyMCE initialization and |
'auto_reset_designmode' must be set to 'true': |
tinyMCE.init({ |
mode : "specific_textareas", |
auto_reset_designmode : true, |
width: "800", |
height: "200" |
}); |
2. Add 'html'=>true parameter to the textarea field definition |
in your phpMyEdit calling program. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'textarea' => array( |
'html' => true, |
'rows' => 11, |
'cols' => 81) |
); |
3. It is also possible to have multiple text area formats on the same |
form. This is done by specifying a text tag for the textarea: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'textarea' => array( |
'html' => 'format1', |
'rows' => 11, |
'cols' => 81) |
); |
You then need to initialize TinyMCE in the header to recognize all of |
the tags used in the textareas. |
EXAMPLE |
In the following, two formats of tinyMCE editor are defined. |
This example is the default, and will be used for any fields where |
'html' is set to true. |
tinyMCE.init({ |
mode : "specific_textareas", |
auto_reset_designmode : true |
}); |
This second example has an extra parameter, 'textarea_trigger', which is |
set to the text tag given to the textarea in PME with 'mce_' prepended |
to it. |
tinyMCE.init({ |
mode : "specific_textareas", |
auto_reset_designmode : true, |
textarea_trigger : "mce_format1", |
theme : "advanced", |
width: "800", |
height: "200", |
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print", |
theme_advanced_buttons1_add_before : "save,separator", |
theme_advanced_buttons1_add : "fontselect,fontsizeselect", |
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor", |
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator", |
theme_advanced_buttons3_add_before : "tablecontrols,separator", |
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print", |
theme_advanced_toolbar_location : "top", |
theme_advanced_toolbar_align : "left", |
theme_advanced_path_location : "bottom", |
content_css : "example_full.css", |
plugin_insertdate_dateFormat : "%Y-%m-%d", |
plugin_insertdate_timeFormat : "%H:%M:%S", |
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]" |
}); |
So: |
'html' => 'format1' maps to textarea_trigger : "mce_format1" |
'html' => 'foo' maps to textarea_trigger : "mce_foo" |
'html' => 'bar' maps to textarea_trigger : "mce_bar" |
You can initialize TinyMCE as many times as you need to give you as many |
editor formats as you need. |
CALENDAR |
This extension enables the display of a popup calendar selection |
against selected fields. |
In order to use it, you should: |
1. Load the jsCalendar scripts in the <head>...</head> section of |
your phpMyEdit calling program, substituting the correct paths: |
<script type="text/javascript" src="js/jscalendar/calendar.js"></script> |
<script type="text/javascript" src="js/jscalendar/lang/calendar-en.js"></script> |
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script> |
2. Choose your preferred jsCalendar CSS file (see jsCalendar |
documentation) and add the following in the <head>...</head> |
section of your phpMyEdit calling program, substituting the |
correct path: |
<link rel="stylesheet" type="text/css" media="screen" |
href="js/jscalendar/calendar-system.css"> |
3. Add 'calendar' parameter to the field definitions where you |
want a calendar popup in your phpMyEdit calling program. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'calendar' => true |
); |
This is will display a button next to the field which pops up |
a calendar when clicked. If that field has a 'strftimemask' |
parameter set, it will use this for the date format. |
For more advanced usage, you can set the 'calendar' parameter |
to an array of valid jsCalendar Calendar.setup options |
(see jSCalendar document for details). Note that not all |
of these options make sense to use in phpMyEdit, and some |
of them will actively break the function. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'calendar' => array( |
'ifFormat' => '%Y/%m/%d', // defaults to the ['strftimemask'] |
'firstDay' => 1, // 0 = Sunday, 1 = Monday |
'singleClick' => true, // single or double click to close |
'weekNumbers' => true, // Show week numbers |
'showsTime' => false, // Show time as well as date |
'timeFormat' => '24', // 12 or 24 hour clock |
'button' => true, // Display button (rather then clickable area) |
'label' => '...', // button label (used by phpMyEdit) |
'date' => '2003-12-19 10:00' // Initial date/time for popup |
// (see notes below) |
) |
); |
NOTES |
----- |
1. The popup will normally set the initial value to the current |
field value or to current date/time. 'date' option will always |
override this, even if there is a current date/time value |
in the field. If you want a default value only if the field |
is currently empty, use the phpMyEdit 'default' option. |
2. Only the options listed above may be set by the user, any other |
options will be ignored. |
3. The 'label' option can contain HTML markup which will be displayed as |
the button/clickable area to pull up the calendar |
SEARCH KEYWORD |
-------------- |
Search for "htmlcal" string in this source code, |
to find all extension related modifications. |
*/ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_mce_cal extends phpMyEdit |
{ |
/* calendar mod start */ |
var $calendars; // Array for collecting list of fields with calendar popups |
/* Array of valid options for passing to Calendar.setup */ |
var $valid_opts = array( |
'button','ifFormat','singleClick','firstDay', |
'weekNumbers','showsTime','timeFormat','date' |
); |
/** |
* Checks to see if the calendar parameter is set on the field |
* |
* @param k current field name |
* @param curval current value of field (set to null for default) |
* |
* If the calendar parameter is set on the field, this function displays |
* the button. It then pushes the Calendar.setup parameters into an array, |
* including the user specified ones in the calling program is they exist. |
* This array is then added to the $calendars array indexed by the field |
* name. This allows for multiple fields with calendar popups. |
*/ |
function calPopup_helper($k, $curval) /* {{{ */ |
{ |
if (@$this->fdd[$k]['calendar']) { |
$cal_ar['ifFormat'] = '%Y-%m-%d %H:%M'; |
$cal_ar['showsTime'] = true; |
$cal_ar['singleClick'] = false; |
if (isset($curval)) { |
if (substr($curval, 0, 4) != '0000') |
$cal_ar['date'] = $curval; |
} |
if (isset($this->fdd[$k]['strftimemask'])) { |
$cal_ar['ifFormat'] = $this->fdd[$k]['strftimemask']; |
} |
if (is_array($this->fdd[$k]['calendar'])) { |
foreach($this->fdd[$k]['calendar'] as $ck => $cv) { |
$cal_ar[$ck] = $cv; |
} |
} |
$cal_ar['button'] = $this->dhtml['prefix'].'calbutton_'.$this->fds[$k]; |
$this->calendars[$this->fds[$k]] = $cal_ar; |
$label = @$this->fdd[$k]['calendar']['label']; |
strlen($label) || $label = '...'; |
$do_button = true; |
if (isset($this->fdd[$k]['calendar']['button'])) { |
$do_button = $this->fdd[$k]['calendar']['button']; |
}; |
if ($do_button) { |
echo '<button id="',$cal_ar['button'],'">',$label,'</button>'; |
} else { |
echo '<span style="cursor: pointer" id="',$cal_ar['button'],'">',$label,'</span>'; |
} |
} |
} /* }}} */ |
/* calendar mod end */ |
function display_add_record() /* {{{ */ |
{ |
for ($tab = 0, $k = 0; $k < $this->num_fds; $k++) { |
if (isset($this->fdd[$k]['tab']) && $this->tabs_enabled() && $k > 0) { |
$tab++; |
echo '</table>',"\n"; |
echo '</div>',"\n"; |
echo '<div id="'.$this->dhtml['prefix'].'tab',$tab,'">',"\n"; |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
} |
if (! $this->displayed[$k]) { |
continue; |
} |
if ($this->hidden($k)) { |
echo $this->htmlHiddenData($this->fds[$k], $this->fdd[$k]['default']); |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix); |
echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">'; |
echo $this->fdd[$k]['name'],'</td>',"\n"; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$selected = @$this->fdd[$k]['default']; |
$multiple = $this->col_has_multiple_select($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, |
$vals, $selected, $multiple, $readonly, $strip_tags, $escape); |
} elseif (isset ($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
}; |
// mce mod start |
if (isset($this->fdd[$k]['textarea']['html'])) { |
$mce_tag = 'editable'; |
if (is_string($this->fdd[$k]['textarea']['html'])) { |
$mce_tag = $this->fdd[$k]['textarea']['html']; |
}; |
echo ' mce_'.$mce_tag.'=true '; |
}; |
// mce mod end |
echo '>',htmlspecialchars($this->fdd[$k]['default']),'</textarea>',"\n"; |
} else { |
// Simple edit box required |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" '; |
echo ($this->password($k) ? 'type="password"' : 'type="text"'); |
echo ($this->readonly($k) ? ' disabled' : ''); |
/* calendar mod start */ |
echo ' id="',$this->dhtml['prefix'].'fld_'.$this->fds[$k],'"'; |
/* calendar mod end */ |
echo ' name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo $size_ml_props,' value="'; |
echo htmlspecialchars($this->fdd[$k]['default']),'">'; |
/* calendar mod start */ |
/* Call htmlcal helper function */ |
$this->calPopup_helper($k, null); |
/* calendar mod end */ |
} |
echo '</td>',"\n"; |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} /* }}} */ |
function display_change_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$multiple = $this->col_has_multiple_select($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($this->cgi['prefix']['data'].$this->fds[$k], $css_class_name, |
$vals, $row["qf$k"], $multiple, $readonly, $strip_tags, $escape); |
} elseif (isset($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->cgi['prefix']['data'].$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
}; |
// mce mod start |
if (isset($this->fdd[$k]['textarea']['html'])) { |
$mce_tag = 'editable'; |
if (is_string($this->fdd[$k]['textarea']['html'])) { |
$mce_tag = $this->fdd[$k]['textarea']['html']; |
}; |
echo ' mce_'.$mce_tag.'=true '; |
}; |
// mce mod end |
echo '>',htmlspecialchars($row["qf$k"]),'</textarea>',"\n"; |
} else { |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled ' : ''); |
/* calendar mod start */ |
echo ' id="',$this->dhtml['prefix'].'fld_'.$this->fds[$k],'"'; |
/* calendar mod end */ |
echo 'name="',$this->cgi['prefix']['data'].$this->fds[$k],'" value="'; |
echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n"; |
/* calendar mod start */ |
/* Call calPopup helper function */ |
$this->calPopup_helper($k, htmlspecialchars($row["qf$k"])); |
/* calendar mod end */ |
} |
echo '</td>',"\n"; |
} /* }}} */ |
function form_end() /* {{{ */ |
{ |
if ($this->display['form']) { |
echo '</form>',"\n"; |
/* calendar mod start */ |
/* Add script calls to the end of the form for all fields |
with calendar popups. */ |
if (isset($this->calendars)) { |
echo '<script type="text/javascript"><!--',"\n"; |
foreach($this->calendars as $ck => $cv) { |
echo 'Calendar.setup({',"\n"; |
foreach ($cv as $ck1 => $cv1) { |
if (in_array($ck1, $this->valid_opts)) { |
echo "\t",str_pad($ck1, 15),' : "',$cv1,'",',"\n"; |
} |
} |
echo "\t",str_pad('inputField', 15),' : "',$this->dhtml['prefix'].'fld_'.$ck,'"',"\n"; |
echo '});',"\n"; |
}; |
echo '// -->',"\n"; |
echo '</script>',"\n"; |
}; |
/* calendar mod end */ |
}; |
} /* }}} */ |
} |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-calpopup.class.php |
---|
New file |
0,0 → 1,357 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-calpopup.class.php - phpMyEdit calendar popup extension |
* ____________________________________________________________ |
* |
* Contribution of Adam Hammond <php@pixolet.co.uk>, London, UK |
* Copyright (c) 2003-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-calpopup.class.php,v 1.9 2006-01-22 21:44:17 nepto Exp $ */ |
/* |
OVERVIEW |
-------- |
NOTE...This extension will not work with the CVS version of PME |
calPopup extends the standard phpMyEdit class to allow |
a calendar popup helper to be put on any text field. |
This extension uses the free jsCalendar code from |
http://dynarch.com/mishoo/calendar.epl website. |
REQUIREMENTS |
------------ |
The requirement is a properly installed jsCalendar script. |
All browsers supported by jsCalendar are supported by this |
extension. |
USAGE |
----- |
This extension enables the display of a popup calendar selection |
against selected fields. |
In order to use it, you should: |
1. Load the jsCalendar scripts in the <head>...</head> section of |
your phpMyEdit calling program, substituting the correct paths: |
<script type="text/javascript" src="js/calendar.js"></script> |
<script type="text/javascript" src="js/lang/calendar-en.js"></script> |
<script type="text/javascript" src="js/calendar-setup.js"></script> |
2. Choose your preferred jsCalendar CSS file (see jsCalendar |
documentation) and add the following in the <head>...</head> |
section of your phpMyEdit calling program, substituting the |
correct path: |
<link rel="stylesheet" type="text/css" media="screen" |
href="css/calendar-system.css"> |
NOTE: To avoid an unwanted side effect in the CSS style |
produced by phpMyEditSetup.php, add a 'width:auto' property |
into the '.calendar table' entry in your selected jsCalendar |
style sheet. |
3. Call to phpMyEdit-calPopup.class.php instead |
of phpMyEdit.class.php. |
Example: |
require_once 'extensions/phpMyEdit-calpopup.class.php'; |
new phpMyEdit_calpopup($opts); |
4. Add 'calendar' parameter to the field definitions where you |
want a calendar popup in your phpMyEdit calling program. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'calendar' => true |
); |
This is will display a button next to the field which pops up |
a calendar when clicked. If that field has a 'strftimemask' |
parameter set, it will use this for the date format. |
For more advanced usage, you can set the 'calendar' parameter |
to an array of valid jsCalendar Calendar.setup options |
(see jSCalendar document for details). Note that not all |
of these options make sense to use in phpMyEdit, and some |
of them will actively break the function. |
Example: |
$opts['fdd']['col_name'] = array( |
'name' => 'Column', |
'select' => 'T', |
'options' => 'ACPVD', |
'required' => true, |
'calendar' => array( |
'ifFormat' => '%Y/%m/%d', // defaults to the ['strftimemask'] |
'firstDay' => 1, // 0 = Sunday, 1 = Monday |
'singleClick' => true, // single or double click to close |
'weekNumbers' => true, // Show week numbers |
'showsTime' => false, // Show time as well as date |
'timeFormat' => '24', // 12 or 24 hour clock |
'label' => '...', // button label (used by phpMyEdit) |
'date' => '2003-12-19 10:00' // Initial date/time for popup |
// (see notes below) |
) |
); |
NOTES |
----- |
1. The popup will normally set the initial value to the current |
field value or to current date/time. 'date' option will always |
override this, even if there is a current date/time value |
in the field. If you want a default value only if the field |
is currently empty, use the phpMyEdit 'default' option. |
2. Only the options listed above may be set by the user, any other |
options will be ignored. |
SEARCH KEYWORD |
-------------- |
Search for "CalPopup" string in this source code, |
to find all extension related modifications. |
*/ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_calpopup extends phpMyEdit |
{ |
/* CalPopup mod start */ |
/* Array for collecting list of fields with calendar popups */ |
var $calendars; |
/* Array of valid options for passing to Calendar.setup */ |
var $valid_opts = array( |
'button','ifFormat','singleClick','firstDay', |
'weekNumbers','showsTime','timeFormat','date' |
); |
/** |
* Checks to see if the calendar parameter is set on the field |
* |
* @param k current field name |
* @param curval current value of field (set to null for default) |
* |
* If the calendar parameter is set on the field, this function displays |
* the button. It then pushes the Calendar.setup parameters into an array, |
* including the user specified ones in the calling program is they exist. |
* This array is then added to the $calendars array indexed by the field |
* name. This allows for multiple fields with calendar popups. |
*/ |
function CalPopup_helper($k, $curval) /* {{{ */ |
{ |
if (@$this->fdd[$k]['calendar']) { |
$cal_ar['ifFormat'] = '%Y-%m-%d %H:%M'; |
$cal_ar['showsTime'] = true; |
$cal_ar['singleClick'] = false; |
if (isset($curval)) { |
if (substr($curval, 0, 4) != '0000') |
$cal_ar['date'] = $curval; |
} |
if (isset($this->fdd[$k]['strftimemask'])) { |
$cal_ar['ifFormat'] = $this->fdd[$k]['strftimemask']; |
} |
if (is_array($this->fdd[$k]['calendar'])) { |
foreach($this->fdd[$k]['calendar'] as $ck => $cv) { |
$cal_ar[$ck] = $cv; |
} |
} |
$cal_ar['button'] = 'pme_calpopup_button_'.$this->fds[$k]; |
$this->calendars[$this->fds[$k]] = $cal_ar; |
$label = @$this->fdd[$k]['calendar']['label']; |
strlen($label) || $label = '...'; |
echo '<button id="',$cal_ar['button'],'">',$label,'</button>'; |
} |
} /* }}} */ |
/* CalPopup mod end */ |
function display_add_record() /* {{{ */ |
{ |
for ($tab = 0, $k = 0; $k < $this->num_fds; $k++) { |
if (isset($this->fdd[$k]['tab']) && $this->tabs_enabled() && $k > 0) { |
$tab++; |
echo '</table>',"\n"; |
echo '</div>',"\n"; |
echo '<div id="phpMyEdit_tab',$tab,'">',"\n"; |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
} |
if (! $this->displayed[$k]) { |
continue; |
} |
if ($this->hidden($k)) { |
echo $this->htmlHidden($this->fds[$k], $row["qf$k"]); |
continue; |
} |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, 'next', $css_postfix); |
echo '<tr class="',$this->getCSSclass('row', null, true, $css_postfix),'">',"\n"; |
echo '<td class="',$this->getCSSclass('key', null, true, $css_postfix),'">',$this->fdd[$k]['name'],'</td>',"\n"; |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$selected = @$this->fdd[$k]['default']; |
$multiple = $this->col_has_multiple_select($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $selected, |
$multiple, $readonly, $strip_tags, $escape); |
} elseif (isset ($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>',htmlspecialchars($this->fdd[$k]['default']),'</textarea>',"\n"; |
} else { |
// Simple edit box required |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
/* CalPopup mod start */ |
if (@$this->fdd[$k]['calendar']) { |
$size_ml_props .= ' id="pme_calpopup_input_'.$this->fds[$k].'"'; |
} |
/* CalPopup mod end */ |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled ' : ''),' name="',$this->fds[$k],'"'; |
echo $size_ml_props,' value="'; |
echo htmlspecialchars($this->fdd[$k]['default']),'">'; |
/* CalPopup mod start */ |
/* Call CalPopup helper function */ |
$this->CalPopup_helper($k, null); |
/* CalPopup mod end */ |
} |
echo '</td>',"\n"; |
if ($this->guidance) { |
$css_class_name = $this->getCSSclass('help', null, true, $css_postfix); |
$cell_value = $this->fdd[$k]['help'] ? $this->fdd[$k]['help'] : ' '; |
echo '<td class="',$css_class_name,'">',$cell_value,'</td>',"\n"; |
} |
echo '</tr>',"\n"; |
} |
} /* }}} */ |
function display_change_field($row, $k) /* {{{ */ |
{ |
$css_postfix = @$this->fdd[$k]['css']['postfix']; |
$css_class_name = $this->getCSSclass('input', null, true, $css_postfix); |
echo '<td class="',$this->getCSSclass('value', null, true, $css_postfix),'"'; |
echo $this->getColAttributes($k),">\n"; |
if ($this->col_has_values($k)) { |
$vals = $this->set_values($k); |
$multiple = $this->col_has_multiple_select($k); |
$readonly = $this->readonly($k); |
$strip_tags = true; |
$escape = true; |
echo $this->htmlSelect($this->fds[$k], $css_class_name, $vals, $row["qf$k"], |
$multiple, $readonly, $strip_tags, $escape); |
} elseif (isset($this->fdd[$k]['textarea'])) { |
echo '<textarea class="',$css_class_name,'" name="',$this->fds[$k],'"'; |
echo ($this->readonly($k) ? ' disabled' : ''); |
if (intval($this->fdd[$k]['textarea']['rows']) > 0) { |
echo ' rows="',$this->fdd[$k]['textarea']['rows'],'"'; |
} |
if (intval($this->fdd[$k]['textarea']['cols']) > 0) { |
echo ' cols="',$this->fdd[$k]['textarea']['cols'],'"'; |
} |
if (isset($this->fdd[$k]['textarea']['wrap'])) { |
echo ' wrap="',$this->fdd[$k]['textarea']['wrap'],'"'; |
} else { |
echo ' wrap="virtual"'; |
} |
echo '>',htmlspecialchars($row["qf$k"]),'</textarea>',"\n"; |
} else { |
$size_ml_props = ''; |
$maxlen = intval($this->fdd[$k]['maxlen']); |
$size = isset($this->fdd[$k]['size']) ? $this->fdd[$k]['size'] : min($maxlen, 60); |
$size && $size_ml_props .= ' size="'.$size.'"'; |
$maxlen && $size_ml_props .= ' maxlength="'.$maxlen.'"'; |
/* CalPopup mod start */ |
if (@$this->fdd[$k]['calendar']) { |
$size_ml_props .= ' id="pme_calpopup_input_'.$this->fds[$k].'"'; |
} |
/* CalPopup mod end */ |
echo '<input class="',$css_class_name,'" type="text" '; |
echo ($this->readonly($k) ? 'disabled ' : ''),'name="',$this->fds[$k],'" value="'; |
echo htmlspecialchars($row["qf$k"]),'" ',$size_ml_props,'>',"\n"; |
/* CalPopup mod start */ |
/* Call CalPopup helper function */ |
$this->CalPopup_helper($k, htmlspecialchars($row["qf$k"])); |
/* CalPopup mod end */ |
} |
echo '</td>',"\n"; |
} /* }}} */ |
function form_end() /* {{{ */ |
{ |
if ($this->display['form']) { |
echo '</form>',"\n"; |
/* CalPopup mod start */ |
/* Add script calls to the end of the form for all fields |
with calendar popups. */ |
if (isset($this->calendars)) { |
echo '<script type="text/javascript"><!--',"\n"; |
foreach($this->calendars as $ck => $cv) { |
echo 'Calendar.setup({',"\n"; |
foreach ($cv as $ck1 => $cv1) { |
if (in_array($ck1, $this->valid_opts)) { |
echo "\t",str_pad($ck1, 15),' : "',$cv1,'",',"\n"; |
} |
} |
echo "\t",str_pad('inputField', 15),' : "pme_calpopup_input_',$ck,'"',"\n"; |
echo '});',"\n"; |
}; |
echo '// --></script>',"\n"; |
}; |
/* CalPopup mod end */ |
}; |
} /* }}} */ |
} |
?> |
/tags/v3.1-blanche-neige/jrest/util/extensions/phpMyEdit-messages.class.php |
---|
New file |
0,0 → 1,329 |
<?php |
/* |
* phpMyEdit - instant MySQL table editor and code generator |
* |
* extensions/phpMyEdit-messages.class.php - phpMyEdit messages extension |
* ____________________________________________________________ |
* |
* Developed by Ondrej Jombik <nepto@platon.sk> |
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/ |
* All rights reserved. |
* |
* See README file for more information about this software. |
* See COPYING file for license information. |
* |
* Download the latest version from |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
/* $Platon: phpMyEdit/extensions/phpMyEdit-messages.class.php,v 1.15 2006-06-17 11:14:54 nepto Exp $ */ |
/* This extension is part of phpMyEzin: Content Management System project, |
where it handles discussion messages for particular articles. It depends on |
some phpMyEzin characteristics, thus extension should not and cannot be used |
outside this project. However there are planned some improvements for future |
to make this extension handle any kind of tree-structured data. */ |
require_once dirname(__FILE__).'/../phpMyEdit.class.php'; |
class phpMyEdit_messages extends phpMyEdit |
{ |
function phpMyEdit_messages($opts) /* {{{ */ |
{ |
$execute = 1; |
isset($opts['execute']) && $execute = $opts['execute']; |
$opts['execute'] = 0; |
parent::phpMyEdit($opts); |
$this->tb2 = $opts['tb2']; |
$this->format_date = $opts['format_date']; |
/* Preserved article ID in CGI environment. */ |
/* TODO: change to $this->article_id or something like this */ |
global $ezin_admin_article; |
$ezin_admin_article = $this->get_data_cgi_var('article_id'); |
$execute && $this->execute(); |
} /* }}} */ |
function list_table() /* {{{ */ |
{ |
$ezin_admin_article_change_up = $this->get_sys_cgi_var('ezin_admin_article_change_up'); |
$ezin_admin_article_change_down = $this->get_sys_cgi_var('ezin_admin_article_change_down'); |
if (isset($ezin_admin_article_change_up)) { |
$ezin_admin_article = $this->get_sys_cgi_var('ezin_admin_article_up'); |
} elseif (isset($ezin_admin_article_change_down)) { |
$ezin_admin_article = $this->get_sys_cgi_var('ezin_admin_article_down'); |
} |
!isset($ezin_admin_article) && $ezin_admin_article = $this->get_data_cgi_var('article_id'); |
$ezin_admin_article = intval($ezin_admin_article); |
$query = sprintf('SELECT article_id, count(id) AS messages FROM %s' |
.' GROUP BY article_id HAVING article_id = %d', |
$this->tb, intval($ezin_admin_article)); |
if (($result = $this->myquery($query)) == false) { |
return false; |
} |
$row = @mysql_fetch_array($result, MYSQL_ASSOC); |
//$ezin_admin_article = intval($row['article_id']); |
$ezin_admin_msgcount = intval($row['messages']); |
@mysql_free_result($result); |
echo '<form class="',$this->getCSSclass('form'); |
echo '" action="',$page_name,'" method="POST">',"\n"; |
if ($this->nav_up() || $ezin_admin_article <= 0) { |
$this->message_nav_buttons($ezin_admin_article, $ezin_admin_msgcount, 'up'); |
echo '<hr class="',$this->getCSSclass('hr', 'up'),'">',"\n"; |
} |
if ($ezin_admin_article > 0) { |
echo '<table class="',$this->getCSSclass('main'),'" summary="',$this->tb,'">',"\n"; |
echo '<tr class="',$this->getCSSclass('header'),'">',"\n"; |
foreach (array('ID', 'Subject', ' ', 'Author', 'Date & Time', 'IP addresses') as $str) { |
echo '<th class="',$this->getCSSclass('header'),'">'; |
echo Platon::htmlspecialchars2($str),'</th>',"\n"; |
} |
echo '</tr>',"\n"; |
echo '<tr class="',$this->getCSSclass('header'),'">',"\n"; |
echo '<th class="',$this->getCSSclass('header'),'" colspan="6">'; |
echo 'Valid messages</td></tr>',"\n"; |
$message_ids = $this->message_process($ezin_admin_article, 0, 0); |
$count_message_ids = count($message_ids); |
if ($count_message_ids == 0) { |
echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n"; |
echo '<td class="',$this->getCSSclass('cell', null, true),'" colspan="6">',"\n"; |
echo '<i>There are no valid messages for this article.</i>'; |
echo '</td></tr>',"\n"; |
} |
$query = sprintf('SELECT id, parent, article_id, author,' |
.' email, homepage, subject, datetime, ip' |
.' FROM %s WHERE article_id = %d ORDER BY datetime ASC', |
$this->tb, intval($ezin_admin_article)); |
if (($result = $this->myquery($query)) == false) { |
return false; |
} |
$all_ids = array(); |
$parents = array(); |
for ($i = 0; ($row = @mysql_fetch_array($result, MYSQL_ASSOC)); $i++) { |
$all_ids[] = $row['id']; |
$parents[$row['id']] = $row['parent']; |
} |
@mysql_free_result($result); |
$all_ids = array_diff($all_ids, $message_ids); |
echo '<tr class="',$this->getCSSclass('header'),'">',"\n"; |
echo '<th class="',$this->getCSSclass('header'),'" colspan="6">'; |
echo 'Invalid messages</td></tr>',"\n"; |
if (count($all_ids) > 0) { |
/* To force buttons */ |
$count_message_ids = -1; |
while (count($all_ids) > 0) { |
//echo "<p>all_ids: "; var_dump($all_ids);echo '<br>'; |
$sub_ids = $this->message_process($ezin_admin_article, |
$parents[array_shift($all_ids)], 0, true); |
$all_ids = array_diff($all_ids, $sub_ids); |
} |
} else { |
echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n"; |
echo '<td class="',$this->getCSSclass('cell', null, true),'" colspan="6">',"\n"; |
echo '<i>There are no invalid messages for this article.</i>'; |
echo '</td></tr>',"\n"; |
} |
echo '</table>'; |
} |
if ($this->nav_down() && $ezin_admin_article > 0) { |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
$this->message_nav_buttons($ezin_admin_article, $ezin_admin_msgcount, 'down'); |
} |
echo $this->htmlHiddenData('article_id', $ezin_admin_article); |
echo '</form>',"\n"; |
} /* }}} */ |
function message_process($article_id, $id, $level = 0, $parent = true) /* {{{ */ |
{ |
$id = intval($id); |
$level = intval($level); |
$query = sprintf('SELECT id, parent, article_id, author,' |
.' email, homepage, subject, datetime, ip' |
.' FROM %s WHERE %s = %d AND article_id = %d' |
.' ORDER BY datetime ASC', $this->tb, |
$parent == true ? 'parent' : 'id', intval($id), intval($article_id)); |
if (($result = $this->myquery($query)) == false) { |
return false; |
} |
$ar = array(); |
$ar_out = array(); |
for ($i = 0; ($row = @mysql_fetch_array($result, MYSQL_ASSOC)); $i++) { |
$ar[$i] = $row; |
$ar_out[] = $row['id']; |
} |
$checked = ! $level && $parent ? ' checked' : ''; |
for ($i = 0; $i < count($ar); $i++) { |
echo '<tr class="',$this->getCSSclass('row', null, 'next'),'">',"\n"; |
$css_class_name = $this->getCSSclass('cell', null, true); |
$css_class_name2 = $this->getCSSclass('navigation', null, true); |
echo '<td class="',$css_class_name,'">',$ar[$i]['id'],'</td>',"\n"; |
echo '<td class="',$css_class_name,'">'; |
for ($j = 0; $j < $level; $j++) { |
echo ' '; |
} |
echo htmlspecialchars($ar[$i]['subject']); |
echo '</td>',"\n"; |
echo '<td class="',$css_class_name2,'">'; |
echo '<input',$checked,' class="',$css_class_name2,'"'; |
echo ' type="radio" ','name="',$this->cgi['prefix']['sys'],'rec"'; |
echo ' value="',$ar[$i]['id'],'" class="link"></td>',"\n"; |
echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['author']), '</td>'; |
echo '<td class="',$css_class_name,'">',htmlspecialchars($ar[$i]['datetime']),'</td>'; |
// TODO: do resolving |
echo '<td class="',$css_class_name,'"><small>'; |
// this shoud be global IP-adress-deliminator |
$output = false; |
$ar_ip = preg_split('|([ ]*[ \\/,;]+[ ]*)|', $ar[$i]['ip'], -1, PREG_SPLIT_DELIM_CAPTURE); |
foreach ($ar_ip as $ip) { |
if (strlen($output) > 0) { |
$output = true; |
} |
$ip = htmlspecialchars($ip); |
if (preg_match('/^(\d{1,3}\.){3}\d{1,3}$/', $ip)) { |
echo '<a class="',$css_class_name,'" target="_blank" href="http://',$ip,'">'; |
echo '<small>',$ip,'</small></a>'; |
} else { |
echo $ip; |
} |
} |
if (! $output) { |
echo ' '; |
} |
echo '</small></td>',"\n"; |
echo '</tr>',"\n"; |
if ($parent) { |
$ar_out = array_merge($ar_out, $this->message_process( |
$article_id, $ar[$i]['id'], $level + 1)); |
} |
strlen($checked) && $checked = ''; |
} |
return $ar_out; |
} /* }}} */ |
function message_nav_buttons($article_id, $messages_count, $position) /* {{{ */ |
{ |
echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
$this->print_article_select($article_id, 0, $position); |
echo '</td>',"\n"; |
echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
if ($article_id > 0) { |
if ($this->add_enabled()) { |
echo $this->htmlSubmit('operation', 'Add', $this->getCSSclass('add', $position), false, false); |
} |
if ($this->view_enabled()) { |
echo ' '; |
echo $this->htmlSubmit('operation', 'View', $this->getCSSclass('view', $position), |
false, $messages_count <= 0); |
} |
if ($this->change_enabled()) { |
echo ' '; |
echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('change', $position), |
false, $messages_count <= 0); |
} |
if ($this->delete_enabled()) { |
echo ' '; |
echo $this->htmlSubmit('operation', 'Delete', $this->getCSSclass('delete', $position), |
false, $messages_count <= 0); |
} |
} |
echo '</td></tr></table>',"\n"; |
} /* }}} */ |
function display_record_buttons() /* {{{ */ |
{ |
echo '<table class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<tr class="',$this->getCSSclass('navigation', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('buttons', $position),'">',"\n"; |
$this->print_article_select($article_id, 1, $position); |
echo '</td>',"\n"; |
if (strlen(@$this->message) > 0) { |
echo '<td class="',$this->getCSSclass('message', $position),'">',$this->message,'</td>',"\n"; |
} |
echo '<td class="',$this->getCSSclass('buttons2', $position),'">',"\n"; |
if ($this->change_operation()) { |
echo $this->htmlSubmit('savechange', 'Save', $this->getCSSclass('save', $position), true), ' '; |
echo $this->htmlSubmit('morechange', 'Apply', $this->getCSSclass('more', $position), true), ' '; |
echo $this->htmlSubmit('cancelchange', 'Cancel', $this->getCSSclass('cancel', $position), false); |
} elseif ($this->add_operation()) { |
echo $this->htmlSubmit('saveadd', 'Save', $this->getCSSclass('save', $position), true), ' '; |
echo $this->htmlSubmit('moreadd', 'More', $this->getCSSclass('more', $position), true), ' '; |
echo $this->htmlSubmit('canceladd', 'Cancel', $this->getCSSclass('cancel', $position), false); |
} elseif ($this->delete_operation()) { |
echo $this->htmlSubmit('savedelete', 'Delete', $this->getCSSclass('save', $position), false), ' '; |
echo $this->htmlSubmit('canceldelete', 'Cancel', $this->getCSSclass('cancel', $position), false); |
} elseif ($this->view_operation()) { |
if ($this->change_enabled()) { |
echo $this->htmlSubmit('operation', 'Change', $this->getCSSclass('save', $position), false), ' '; |
} |
echo $this->htmlSubmit('cancelview', 'Cancel', $this->getCSSclass('cancel', $position), false); |
} |
// Message is now written here |
echo '</td>',"\n"; |
echo '</tr></table>',"\n"; |
} /* }}} */ |
function print_article_select($selected_id, $disabled, $position) /* {{{ */ |
{ |
if ($selected_id <= 0) { |
$rec = intval($this->get_sys_cgi_var('rec')); |
if ($rec > 0) { |
$query = sprintf('SELECT article_id FROM %s WHERE id = %d', |
$this->tb, $rec); |
$result = $this->myquery($query); |
if ($result != false) { |
$row = @mysql_fetch_array($result, MYSQL_NUM); |
$selected_id = $row[0]; |
} |
@mysql_free_result($result); |
} |
} |
static $articles = null; |
if ($articles == null) { |
$articles = array(); |
$query = 'SELECT id, title, atitle, UNIX_TIMESTAMP(datetime) AS date' |
.' FROM '.$this->tb2 |
.' ORDER BY date DESC'; |
if (($result = $this->myquery($query)) == false) { |
return false; |
} |
for ($k = 0; ($row = @mysql_fetch_array($result, MYSQL_ASSOC)); $k++) { |
$articles[] = $row; |
} |
@mysql_free_result($result); |
} |
echo '<select',($disabled ? ' disabled' : ''),' name="'; |
echo $this->cgi['prefix']['sys'].'ezin_admin_article_',$position,'" size="1">',"\n"; |
echo '<option value="0">-- Choose article --</option>',"\n"; |
foreach ($articles as $row) { |
$row['title'] = empty($row['title']) ? $row['atitle'] : $row['title']; |
$row['title'] = Platon::pretty_substr(strip_tags($row['title']), 40); |
echo '<option'.($selected_id == $row['id'] ? ' selected' : ''); |
echo ' value="',$row['id'],'">',$row['title']; |
if ($row['date'] > 0) { |
printf(' [%d] (%s)', $row['id'], date($this->format_date, $row['date'])); |
} |
echo '</option>',"\n"; |
} |
echo '</select>',"\n"; |
if (! $disabled) { |
echo $this->htmlSubmit('ezin_admin_article_change_'.$position, ' > ', $this->get_sys_cgi_var('change', $position)), ' ', "\n"; |
} |
return true; |
} /* }}} */ |
} |
/* Modeline for ViM {{{ |
* vim:set ts=4: |
* vim600:fdm=marker fdl=0 fdc=0: |
* }}} */ |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.EL.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: greek |
* encoding: iso-8859-7 |
* date: 2005-08-03 |
* author: Alexandros Vellis <avel@users.sourceforge.net> |
*/ |
/* $Id$ */ |
return Array( |
'Add' =>'Ðñüóèåóç', |
'Copy' =>'ÁíôéãñáöÞ', |
'Change' =>'ÁëëáãÞ', |
'Delete' =>'ÄéáãñáöÞ', |
'View' =>'ÅìöÜíéóç', |
'Prev' =>'Ðñïçãïýìåíï', |
'Next' =>'Åðüìåíï', |
'First' =>'Ðñþôï', |
'Last' =>'Ôåëåõôáßï', |
'Go to' =>'ÐÞãáéíå óå', |
'Page' =>'Óåëßäá', |
'Records' =>'ÅããñáöÝò', |
'Save' =>'ÁðïèÞêåõóç', |
'More' =>'Ðåñéóóüôåñá', |
'Apply' =>'ÕðïâïëÞ', |
'Cancel' =>'Áêýñùóç', |
'Search' =>'ÁíáæÞôçóç', |
'Hide' =>'Êñýøå', |
'Clear' =>'ÊáèÜñéóå', |
'Query' =>'Åðåñþôçìá', |
'Current Query' =>'ÔñÝ÷ïí Åðåñþôçìá', |
'Sorted By' =>'Ôáîéíüìçóç Ìå', |
'ascending' =>'áýîïõóá', |
'descending' =>'öèßíïõóá', |
'hidden' =>'êñõììÝíï', |
'of' =>'áðü', |
'record added' =>'ç åããñáöÞ ðñïóôÝèçêå', |
'record changed' =>'ç åããñáöÞ Üëëáîå', |
'record deleted' =>'ç åããñáöÞ äéáãñÜöçêå', |
'Please enter' =>'Ðáñáêáëþ åéóÜãåôå', |
'months' => Array( |
'01'=>'ÉáíïõÜñéïò', |
'02'=>'ÖåâñïõÜñéïò', |
'03'=>'ÌÜñôéïò', |
'04'=>'Áðñßëéïò', |
'05'=>'ÌÜéïò', |
'06'=>'Éïýíéïò', |
'07'=>'Éïýëéïò', |
'08'=>'Áýãïõóôïò', |
'09'=>'ÓåðôÝìâñéïò', |
'10'=>'Ïêôþâñéïò', |
'11'=>'ÍïÝìâñéïò', |
'12'=>'ÄåêÝìâñéïò'), |
// phpMyEdit-report |
'Make report' => 'Äçìéïõñãßá áíáöïñÜò', |
'Select fields' => 'ÅðéëïãÞ ðåäßùí', |
'Records per screen' => 'ÅããñáöÝò áíÜ ïèüíç', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.EN.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: english |
* encoding: iso-8859-1 |
* date: 2000, 2001, 2003-05-01 |
* author: John McCreesh <jpmcc@users.sourceforge.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.EN.inc,v 1.11 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Add', |
'Copy' =>'Copy', |
'Change' =>'Change', |
'Delete' =>'Delete', |
'View' =>'View', |
'Prev' =>'Prev', |
'Next' =>'Next', |
'First' =>'First', |
'Last' =>'Last', |
'Go to' =>'Go to', |
'Page' =>'Page', |
'Records' =>'Records', |
'Save' =>'Save', |
'More' =>'More', |
'Apply' =>'Apply', |
'Cancel' =>'Cancel', |
'Search' =>'Search', |
'Hide' =>'Hide', |
'Clear' =>'Clear', |
'Query' =>'Query', |
'Current Query' =>'Current Query', |
'Sorted By' =>'Sorted By', |
'ascending' =>'ascending', |
'descending' =>'descending', |
'hidden' =>'hidden', |
'of' =>'of', |
'record added' =>'record added', |
'record changed' =>'record changed', |
'record deleted' =>'record deleted', |
'Please enter' =>'Please enter', |
'months' => Array( |
'01'=>'January', |
'02'=>'February', |
'03'=>'March', |
'04'=>'April', |
'05'=>'May', |
'06'=>'June', |
'07'=>'July', |
'08'=>'August', |
'09'=>'September', |
'10'=>'October', |
'11'=>'November', |
'12'=>'December'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.SE.inc |
---|
New file |
0,0 → 1,73 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: swedish |
* encoding: iso-8859-1 |
* date: 2004-01-21, 2004-02-07 |
* authors: |
* Björn Hammarbäck <bjorn@hammarback.se> |
* Stefan Lindmark <stefan@lindmark.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.SE.inc,v 1.4 2004-12-27 20:14:29 nepto Exp $ */ |
/* |
* å = å |
* ä = ä |
* ö = ö |
* Ä = Ä |
*/ |
return Array( |
'Add' =>'Lägg till', |
'Copy' =>'Kopiera', |
'Change' =>'Ändra', |
'Delete' =>'Ta bort', |
'View' =>'Visa detaljer', |
'Prev' =>'Föregående', |
'Next' =>'Nästa', |
'First' =>'Första', |
'Last' =>'Sista', |
'Go to' =>'Gå till sida', |
'Page' =>'Sida', |
'Records' =>'Poster', |
'Save' =>'Spara', |
'More' =>'Mer', |
'Apply' =>'Verkställ', |
'Cancel' =>'Avbryt', |
'Search' =>'Sök', |
'Hide' =>'Dölj', |
'Clear' =>'Rensa', |
'Query' =>'Sök', |
'Current Query' =>'Nuvarande fråga', |
'Sorted By' =>'Sorterad efter', |
'ascending' =>'stigande', |
'descending' =>'fallande', |
'hidden' =>'gömd', |
'of' =>'av', |
'record added' =>'post adderad', |
'record changed' =>'post ändrad', |
'record deleted' =>'post borttagen', |
'Please enter' =>'Fyll i fältet', |
'months' => Array( |
'01'=>'Januari', |
'02'=>'Februari', |
'03'=>'Mars', |
'04'=>'April', |
'05'=>'Maj', |
'06'=>'Juni', |
'07'=>'Juli', |
'08'=>'Augusti', |
'09'=>'September', |
'10'=>'Oktober', |
'11'=>'November', |
'12'=>'December'), |
// phpMyEdit-report |
'Make report' => 'Skapa rapport', |
'Select fields' => 'Välj fält', |
'Records per screen' => 'Poster per skärm', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ES-AR.inc |
---|
New file |
0,0 → 1,59 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: spanish (argentinian) |
* encoding: iso-8859-1 |
* date: 2003-02-28, 2004-02-15 |
* author: Mariano Vassallo <mvassallo@ciudad.com.ar> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ES-AR.inc,v 1.5 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Agregar', |
'Copy' =>'Copiar', |
'Change' =>'Cambiar', |
'Delete' =>'Suprimir', |
'View' =>'Visualización', |
'Prev' =>'Anterior', |
'Next' =>'Siguiente', |
'First' =>'Primero', |
'Last' =>'Ultimo', |
'Go to' =>'Ir a', |
'Page' =>'Paginación', |
'Records' =>'Registros', |
'Save' =>'Grabar', |
'More' =>'Más', |
'Apply' =>'Aplicar', |
'Cancel' =>'Cancelar', |
'Search' =>'Buscar', |
'Hide' =>'Ocultar', |
'Clear' =>'Limpiar', |
'Query' =>'Consulta', |
'of' =>'/', // intentionaly untranslated. Alternatve: "de" |
'record added' =>'registro añadido', |
'record changed'=>'registro cambiado', |
'record deleted'=>'registro borrado', |
'Please enter' =>'Por favor introduzca ', |
'months' => Array( |
'01'=>'Enero', |
'02'=>'Febrero', |
'03'=>'Marzo', |
'04'=>'Abril', |
'05'=>'Mayo', |
'06'=>'Junio', |
'07'=>'Julio', |
'08'=>'Agosto', |
'09'=>'Septiembre', |
'10'=>'Octubre', |
'11'=>'Noviembre', |
'12'=>'Diciembre'), |
// phpMyEdit-report |
'Make report' => 'Hacer reporte', |
'Select fields' => 'Seleccionar campos', |
'Records per screen' => 'Registros por pantalla', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ES.inc |
---|
New file |
0,0 → 1,66 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: spanish |
* encoding: iso-8859-1 |
* date: 2003-02, 2003-04-22, 2004-04-04 |
* authors: |
* Jorge Nadal <jornamon@ya.com> |
* Eduardo Diaz <ediaz@pk25.com> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ES.inc,v 1.6 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Agregar', |
'Copy' =>'Copiar', |
'Change' =>'Cambiar', |
'Delete' =>'Suprimir', |
'View' =>'Visualizar', |
'Prev' =>'Anterior', |
'Next' =>'Siguiente', |
'First' =>'Primero', |
'Last' =>'Último', |
'Go to' =>'Ir a', |
'Page' =>'Página', |
'Records' =>'Registros', |
'Save' =>'Grabar', |
'More' =>'Más', |
'Apply' =>'Aplicar', |
'Cancel' =>'Cancelar', |
'Search' =>'Buscar', |
'Hide' =>'Ocultar', |
'Clear' =>'Limpiar', |
'Query' =>'Consultar', |
'Current Query' =>'Consulta actual', |
'Sorted By' =>'Ordenado por', |
'ascending' =>'ascendente', |
'descending' =>'descendente', |
'hidden' =>'oculto', |
'of' =>'de', |
'record added' =>'Registro añadido', |
'record changed'=>'Registro cambiado', |
'record deleted'=>'Registro borrado', |
'Please enter' =>'Por favor introduzca ', |
'months' => Array( |
'01'=>'Enero', |
'02'=>'Febrero', |
'03'=>'Marzo', |
'04'=>'Abril', |
'05'=>'Mayo', |
'06'=>'Junio', |
'07'=>'Julio', |
'08'=>'Agosto', |
'09'=>'Septiembre', |
'10'=>'Octubre', |
'11'=>'Noviembre', |
'12'=>'Diciembre'), |
// phpMyEdit-report |
'Make report' => 'Realizar Informe', |
'Select fields' => 'Seleccionar campos', |
'Records per screen' => 'Registros por pantalla', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.FR.inc |
---|
New file |
0,0 → 1,67 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: french (standard) |
* encoding: iso-8859-1 |
* date: 2002-02, 2002-11-07, 2002-12-29 |
* authors: |
* Dario <dartar@users.sourceforge.net> |
* Kaid <kaid@fr.st> |
* hbernard <hbernard@gynov.org> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.FR.inc,v 1.15 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Ajouter', |
'Copy' =>'Copier', |
'Change' =>'Modifier', |
'Delete' =>'Supprimer', |
'View' =>'Afficher', |
'Prev' =>'Précédent', |
'Next' =>'Suivant', |
'First' =>'Début', |
'Last' =>'Fin', |
'Go to' =>'Aller à ', |
'Page' =>'Page', |
'Records' =>'Enregistrements', |
'Save' =>'Enregistrer', |
'More' =>'Enregistrer et continuer', |
'Apply' =>'Appliquer', |
'Cancel' =>'Annuler', |
'Search' =>'Rechercher', |
'Hide' =>'Cacher', |
'Clear' =>'Vider', |
'Query' =>'Requête', |
'Current Query' =>'Requête courante', |
'Sorted By' =>'Tri', |
'ascending' =>'croissant', |
'descending' =>'décroissant', |
'hidden' =>'caché', |
'of' =>'/', // untranslated |
'record added' =>'Enregistrement ajouté', |
'record changed'=>'Enregistrement modifié', |
'record deleted'=>'Enregistrement supprimé', |
'Please enter' =>'Entrez s\'il vous plaît', |
'months' => Array( |
'01'=>'Janvier', |
'02'=>'Février', |
'03'=>'Mars', |
'04'=>'Avril', |
'05'=>'Mai', |
'06'=>'Juin', |
'07'=>'Juillet', |
'08'=>'Août', |
'09'=>'Septembre', |
'10'=>'Octobre', |
'11'=>'Novembre', |
'12'=>'Décembre'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ET.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: estonian |
* encoding: any latin |
* date: 2005-09-13 |
* author: Alexia Death <alexiadeath@hotmail.com> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ET.inc,v 1.1 2005-09-14 13:40:19 nepto Exp $ */ |
return Array( |
'Add' =>'Lisa', |
'Copy' =>'Kopeeri', |
'Change' =>'Muuda', |
'Delete' =>'Kustuta', |
'View' =>'Vaata', |
'Prev' =>'Eelmine', |
'Next' =>htmlentities('Järgmine'), |
'First' =>'Esimene', |
'Last' =>'Viimane', |
'Go to' =>'Positsioon', |
'Page' =>'Leht', |
'Records' =>'Kirjed', |
'Save' =>'Salvesta', |
'More' =>htmlentities('Järgneb...'), |
'Apply' =>'Rakenda muutused', |
'Cancel' =>htmlentities('Tühista'), |
'Search' =>'Otsi', |
'Hide' =>'Peida', |
'Clear' =>htmlentities('Tühjenda väljad'), |
'Query' =>htmlentities('Päring'), |
'Current Query' =>htmlentities('Hetke päring'), |
'Sorted By' =>htmlentities('Sorteermisjärjekord'), |
'ascending' =>'kahanevalt', |
'descending' =>'kasvavalt', |
'hidden' =>'peidetud', |
'of' =>'/', |
'record added' =>'kirje lisatud', |
'record changed' =>'kirje muudetud', |
'record deleted' =>'kirje kustutatud', |
'Please enter' =>'Palun sisesta', |
'months' => Array( |
'01'=>'Jaanuar', |
'02'=>'Veebruar', |
'03'=>htmlentities('Märts'), |
'04'=>'Aprill', |
'05'=>'Mai', |
'06'=>'Juuni', |
'07'=>'Juuli', |
'08'=>'August', |
'09'=>'September', |
'10'=>'Oktoober', |
'11'=>'November', |
'12'=>'Detsember'), |
// phpMyEdit-report |
'Make report' => 'Koosta raport', |
'Select fields' => htmlentities('Vali väljad'), |
'Records per screen' => 'Kirjeid lehe kohta', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.EU.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: basque |
* encoding: iso-8859-1 |
* date: 2004-05-11 |
* author: Ibon Igartua <ibon@zuhar.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.EU.inc,v 1.1 2004-05-17 10:53:06 nepto Exp $ */ |
return Array( |
'Add' =>'Gehitu', |
'Copy' =>'Kopiatu', |
'Change' =>'Aldatu', |
'Delete' =>'Ezabatu', |
'View' =>'Ikusi', |
'Prev' =>'Aurrekoa', |
'Next' =>'Hurrengoa', |
'First' =>'Lehena', |
'Last' =>'Azkena', |
'Go to' =>'Joan', |
'Page' =>'Orrialdea', |
'Records' =>'Erregistroak', |
'Save' =>'Gorde', |
'More' =>'Gehiago', |
'Apply' =>'Aplikatu', |
'Cancel' =>'Utzi', |
'Search' =>'Bilatu', |
'Hide' =>'Ezkutatu', |
'Clear' =>'Garbitu', |
'Query' =>'Kontsulta', |
'Current Query' =>'Uneko Kontsulta', |
'Sorted By' =>'Orden Irizpidea', |
'ascending' =>'gorantz', |
'descending' =>'beherantz', |
'hidden' =>'ezkutukoa', |
'of' =>'-', |
'record added' =>'erregistroa gehituta', |
'record changed'=>'erregistroa aldatuta', |
'record deleted'=>'erregistroa ezabatuta', |
'Please enter' =>'Mesedez, sartu ezazu ', |
'months' => Array( |
'01'=>'urtarrila', |
'02'=>'otsaila', |
'03'=>'martxoa', |
'04'=>'apirila', |
'05'=>'maiatza', |
'06'=>'ekaina', |
'07'=>'uztaila', |
'08'=>'abuztua', |
'09'=>'iraila', |
'10'=>'urria', |
'11'=>'azaroa', |
'12'=>'abendua'), |
// phpMyEdit-report |
'Make report' => 'Txostena sortu', |
'Select fields' => 'Eremuak aukertau', |
'Records per screen' => 'Erregistroak orrialdeko', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.NL.inc |
---|
New file |
0,0 → 1,68 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: dutch (standard) |
* encoding: iso-8859-1 |
* date: 2002-09-21, 2002-12-17, 2006-01-05 |
* authors: |
* Paul Barends <pbarends@xs4all.nl> |
* Erwin Janszen <Erwin.Janszen@mail.ing.nl> |
* URL: |
* http://platon.sk/projects/bug_view_advanced_page.php?f_bug_id=197 |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.NL.inc,v 1.16 2006-01-05 04:45:22 nepto Exp $ */ |
return Array( |
'Add' =>'Toevoegen', |
'Copy' =>'Kopiëren', |
'Change' =>'Bewerken', |
'Delete' =>'Wissen', |
'View' =>'Details', |
'Prev' =>'Vorige', |
'Next' =>'Volgende', |
'First' =>'Eerste', |
'Last' =>'Laatste', |
'Go to' =>'Ga naar', |
'Page' =>'Pagina', |
'Records' =>'Rijen', |
'Save' =>'Bewaren', |
'More' =>'Meer', |
'Apply' =>'Toepassen', |
'Cancel' =>'Annuleren', |
'Search' =>'Zoeken', |
'Hide' =>'Verbergen', |
'Clear' =>'Schonen', // 'Leeg maken', |
'Query' =>'Selecteer', // 'Selectie maken', |
'Current Query' =>'Huidige selectie', |
'Sorted By' =>'Gesorteerd op', |
'ascending' =>'oplopend', |
'descending' =>'aflopend', |
'hidden' =>'verborgen', |
'of' =>'van', |
'record added' =>'rij toegevoegd', |
'record changed' =>'rij aangepast', |
'record deleted' =>'rij gewist', |
'Please enter' =>'Voer a.u.b. in:', |
'months' => Array( |
'01'=>'januari', |
'02'=>'februari', |
'03'=>'maart', |
'04'=>'april', |
'05'=>'mei', |
'06'=>'juni', |
'07'=>'juli', |
'08'=>'augustus', |
'09'=>'september', |
'10'=>'october', |
'11'=>'november', |
'12'=>'december'), |
// phpMyEdit-report |
'Make report' => 'Maak rapport', |
'Select fields' => 'Selecteer velden', |
'Records per screen' => 'Rij per scherm', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.PL.inc |
---|
New file |
0,0 → 1,60 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: polish |
* encoding: iso-8859-2 |
* date: 2002-10-01, 2003-06-30 |
* author: Piotr Walesiuk <p.walesiuk@bos.com.pl> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.PL.inc,v 1.9 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Dodaj', |
'Copy' =>'Kopiuj', |
'Change' =>'Zmieñ', |
'Delete' =>'Usuñ', |
'View' =>'Poka¿', |
'Prev' =>'Wstecz', |
'Next' =>'Dalej', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'Strona', |
'Records' =>'Rekordy', |
'Save' =>'Zapisz', |
'More' =>'Wiêcej', |
'Apply' =>'Zastosuj', |
'Cancel' =>'Anuluj', |
'Search' =>'Szukaj', |
'Hide' =>'Ukryj', |
'Clear' =>'Wyczy¶æ', |
'Query' =>'Zapytanie', |
'Current Query' =>'Aktualne zapytanie', |
'Sorted By' =>'Posortowane wed³ug', |
'ascending' =>'rosn±co', |
'descending' =>'malej±co', |
'hidden' =>'ukryte', |
'of' =>'z', |
'record added' =>'rekord dodany', |
'record changed'=>'rekord zmieniony', |
'record deleted'=>'rekord usuniêty', |
'Please enter' =>'Proszê wprowadziæ', |
'months' => Array( |
'01'=>'Styczeñ', |
'02'=>'Luty', |
'03'=>'Marzec', |
'04'=>'Kwiecieñ', |
'05'=>'Maj', |
'06'=>'Czerwiec', |
'07'=>'Lipiec', |
'08'=>'Sierpieñ', |
'09'=>'Wrzesieñ', |
'10'=>'Pa¼dziernik', |
'11'=>'Listopad', |
'12'=>'Grudzieñ') |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.CZ.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: czech |
* encoding: iso-8859-2 |
* date: 2005-04-26 |
* author: Jan Cinert <ion_lord@seznam.cz> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.CZ.inc,v 1.1 2005-04-26 13:15:38 nepto Exp $ */ |
return Array( |
'Add' =>'Pøidat', |
'Copy' =>'Kopírovat', |
'Change' =>'Zmìnit', |
'Delete' =>'Smazat', |
'View' =>'Zobrazit', |
'Prev' =>'Pøedcházející', |
'Next' =>'Následující', |
'First' =>'První', |
'Last' =>'Poslední', |
'Go to' =>'Otevøít', |
'Page' =>'Stránka', |
'Records' =>'Záznamù', |
'Save' =>'Ulo¾it', |
'More' =>'Více', |
'Apply' =>'Pou¾ít', |
'Cancel' =>'Zru¹it', |
'Search' =>'Hledat', |
'Hide' =>'Skrýt', |
'Clear' =>'Smazat', |
'Query' =>'Dotaz', |
'Current Query' =>'Stávající dotaz', |
'Sorted By' =>'Uspoøádané podle', |
'ascending' =>'vzestupnì', |
'descending' =>'sestupnì', |
'hidden' =>'skrytý', |
'of' =>'z', |
'record added' =>'pøidaný záznam', |
'record changed'=>'zmìnìný záznam', |
'record deleted'=>'smazaný záznam', |
'Please enter' =>'Zadejte prosím', |
'months' => Array( |
'01'=>'Leden', |
'02'=>'Únor', |
'03'=>'Bøezen', |
'04'=>'Duben', |
'05'=>'Kvìten', |
'06'=>'Èerve', |
'07'=>'Èervenec', |
'08'=>'Srpen', |
'09'=>'Záøí', |
'10'=>'Øíjen', |
'11'=>'Listopad', |
'12'=>'Prosinec'), |
// phpMyEdit-report |
'Make report' => 'Vytvoøit zprávu', |
'Select fields' => 'Vybrat pole', |
'Records per screen' => 'Poèet záznamù na stránce', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.IT.inc |
---|
New file |
0,0 → 1,66 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: italian (standard) |
* encoding: iso-8859-1 |
* date: 2002-02, 2002-11-07, 2003-04-13, 2004-03-31 |
* authors: |
* Dario <dartar@users.sourceforge.net> |
* Keatch <raffaele.spangaro@eurika.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.IT.inc,v 1.15 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Aggiungi', |
'Copy' =>'Copia', |
'Change' =>'Modifica', |
'Delete' =>'Cancella', |
'View' =>'Visualizza', |
'Prev' =>'Precedente', |
'Next' =>'Seguente', |
'First' =>'Prima', |
'Last' =>'Ultima', |
'Go to' =>'Vai a', |
'Page' =>'Pagina', |
'Records' =>'Voci', |
'Save' =>'Salva', |
'More' =>'Salva & Continua', |
'Apply' =>'Applica', |
'Cancel' =>'Annulla', |
'Search' =>'Cerca', |
'Hide' =>'Nascondi', |
'Clear' =>'Svuota', |
'Query' =>'Chiedi', |
'Current Query' =>'Richiesta Corrente', |
'Sorted By' =>'Ordinato per', |
'ascending' =>'crescente', |
'descending' =>'decrescente', |
'hidden' =>'nascosto', |
'of' =>'/', |
'record added' =>'voce aggiunta', |
'record changed'=>'voce modificata', |
'record deleted'=>'voce eliminata', |
'Please enter' =>'Si prega di riempire il campo: ', |
'months' => Array( |
'01'=>'Gennaio', |
'02'=>'Febbraio', |
'03'=>'Marzo', |
'04'=>'Aprile', |
'05'=>'Maggio', |
'06'=>'Giugno', |
'07'=>'Luglio', |
'08'=>'Agosto', |
'09'=>'Settembre', |
'10'=>'Ottobre', |
'11'=>'Novembre', |
'12'=>'Dicembre'), |
// phpMyEdit-report |
'Make report' => 'Genera report', |
'Select fields' => 'Seleziona campi', |
'Records per screen' => 'Record per schermata', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.SK.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: slovak |
* encoding: iso-8859-2 |
* date: 2002-02-02, 2003-05-01 |
* author: Ondrej Jombik <nepto@php.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.SK.inc,v 1.12 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Prida»', |
'Copy' =>'Kopírova»', |
'Change' =>'Zmeni»', |
'Delete' =>'Zmaza»', |
'View' =>'Pozrie»', |
'Prev' =>'Predchádzajúci', |
'Next' =>'Ïal¹í', |
'First' =>'Prvý', |
'Last' =>'Posledný', |
'Go to' =>'Choï na', |
'Page' =>'Stránka', |
'Records' =>'Záznamov', |
'Save' =>'Ulo¾i»', |
'More' =>'Viac', |
'Apply' =>'Pou¾i»', |
'Cancel' =>'Storno', |
'Search' =>'Hµada»', |
'Hide' =>'Skry»', |
'Clear' =>'Zru¹i»', |
'Query' =>'Vyhµada»', |
'Current Query' =>'Aktuálny dotaz', |
'Sorted By' =>'Usporiadané podµa', |
'ascending' =>'vzostupne', |
'descending' =>'zostupne', |
'hidden' =>'skryté', |
'of' =>'z', |
'record added' =>'záznam pridaný', |
'record changed'=>'záznam zmenený', |
'record deleted'=>'záznam zmazaný', |
'Please enter' =>'Prosím zadajte', |
'months' => Array( |
'01'=>'Január', |
'02'=>'Február', |
'03'=>'Marec', |
'04'=>'Apríl', |
'05'=>'Máj', |
'06'=>'Jún', |
'07'=>'Júl', |
'08'=>'August', |
'09'=>'September', |
'10'=>'Október', |
'11'=>'November', |
'12'=>'December'), |
// phpMyEdit-report |
'Make report' => 'Vytvori» report', |
'Select fields' => 'Vybra» ståpce', |
'Records per screen' => 'Poèet záznamov na stránke', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.RO.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: romanian |
* encoding: iso-8859-1 |
* date: 2004-12-23 |
* author: Sebastian Proksch <sproksch@yahoo.com> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.RO.inc,v 1.2 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Adauga', |
'Copy' =>'Copiaza', |
'Change' =>'Modifica', |
'Delete' =>'Sterge', |
'View' =>'Vizualizeaza', |
'Prev' =>'Precedentul', |
'Next' =>'Urmatorul', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'Pagina', |
'Records' =>'Inregistrari', |
'Save' =>'Salveaza', |
'More' =>'Mai mult', |
'Apply' =>'Aplica', |
'Cancel' =>'Anuleaza', |
'Search' =>'Cauta', |
'Hide' =>'Ascunde', |
'Clear' =>'Anuleaza tot', |
'Query' =>'Interogare', |
'Current Query' =>'Interogarea curenta', |
'Sorted By' =>'Sortat dupa', |
'ascending' =>'crescator', |
'descending' =>'descrescator', |
'hidden' =>'ascuns', |
'of' =>'din', |
'record added' =>'inregistrare adaugata', |
'record changed'=>'inregistrare modificata', |
'record deleted'=>'inregistrare stearsa', |
'Please enter' =>'Introduceti va rog', |
'months' => Array( |
'01'=>'Ianuarie', |
'02'=>'Februarie', |
'03'=>'Martie', |
'04'=>'Aprilie', |
'05'=>'Mai', |
'06'=>'Iunie', |
'07'=>'Iulie', |
'08'=>'August', |
'09'=>'Septembrie', |
'10'=>'Octombrie', |
'11'=>'Noiembrie', |
'12'=>'Decembrie'), |
// phpMyEdit-report // untranslated |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ZH.inc |
---|
New file |
0,0 → 1,66 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: chinese (traditional) |
* encoding: big5 |
* date: 2003-06-26, 2004-10-17 |
* authors: |
* Pao-Hsi Huang <doggy@miniasp.com> |
* Manix Sio <manixsio@gmail.com> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ZH.inc,v 1.5 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'·s¼W', |
'Copy' =>'½Æ»s', |
'Change' =>'Åܧó', |
'Delete' =>'§R°£', |
'View' =>'À˵ø', |
'Prev' =>'¤W¤@¶', |
'Next' =>'¤U¤@¶', |
'First' =>'²Ä¤@¶', |
'Last' =>'³Ì¥½¤@¶', |
'Go to' =>'«e©¹', |
'Page' =>'¶¼Æ', |
'Records' =>'¸ê®Æµ§¼Æ', |
'Save' =>'Àx¦s', |
'More' =>'Àx¦s«áÄ~Äò·s¼W', |
'Apply' =>'®M¥Î', |
'Cancel' =>'¨ú®ø', |
'Search' =>'·j´M', |
'Hide' =>'ÁôÂÃ', |
'Clear' =>'²M°£', |
'Query' =>'¬d¸ß', |
'Current Query' =>'¥Ø«e¬d¸ß±ø¥ó', |
'Sorted By' =>'±Æ§Ç¨Ì¾Ú', |
'ascending' =>'¤É¾±Æ§Ç', |
'descending' =>'°¾±Æ§Ç', |
'hidden' =>'ÁôÂÃ', |
'of' =>'Á`¦@¶¼Æ', |
'record added' =>'µ§¸ê®Æ³Q·s¼W', |
'record changed' =>'µ§¸ê®Æ³Q§ó·s', |
'record deleted' =>'µ§¸ê®Æ³Q§R°£', |
'Please enter' =>'½Ð¿é¤J', |
'months' => Array( |
'01'=>'¤@¤ë', |
'02'=>'¤G¤ë', |
'03'=>'¤T¤ë', |
'04'=>'¥|¤ë', |
'05'=>'¤¤ë', |
'06'=>'¤»¤ë', |
'07'=>'¤C¤ë', |
'08'=>'¤K¤ë', |
'09'=>'¤E¤ë', |
'10'=>'¤Q¤ë', |
'11'=>'¤Q¤@¤ë', |
'12'=>'¤Q¤G¤ë'), |
// phpMyEdit-report |
'Make report' => '²£¥Í³øªí', |
'Select fields' => '¿ï¨úÄæ¦ì', |
'Records per screen' => '¨C¶µ§¼Æ', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.PT.inc |
---|
New file |
0,0 → 1,67 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: portuguese (standard) |
* encoding: iso-8859-1 |
* date: 2002-02 |
* author: unknown |
* |
* last_edit: 2006-05-23 by Sérgio Sanches <ssanches@dcc.online.pt> |
* last_edit_purpose: full translation and correction |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.PT.inc,v 1.6 2006-05-29 08:18:04 nepto Exp $ */ |
return Array( |
'Add' =>'Adicionar', |
'Copy' =>'Copiar', |
'Change' =>'Mudar', |
'Delete' =>'Apagar', |
'View' =>'Ver', |
'Prev' =>'Anterior', |
'Next' =>'Seguinte', |
'First' =>'Primeiro', |
'Last' =>'Último', |
'Go to' =>'Ir para', |
'Page' =>'Página', |
'Records' =>'Registos', |
'Save' =>'Guardar', |
'More' =>'Mais', |
'Apply' =>'Aplicar', |
'Cancel' =>'Cancelar', |
'Search' =>'Procurar', |
'Hide' =>'Esconder', |
'Clear' =>'Limpar', |
'Query' =>'Pesquisa', |
'Current Query' =>'Pesquisa Actual', |
'Sorted By' =>'Ordenado Por', |
'ascending' =>'ascendente', |
'descending' =>'descendente', |
'hidden' =>'escondido', |
'of' =>'de', |
'record added' =>'registo adicionado', |
'record changed' =>'registo alterado', |
'record deleted' =>'registo apagado', |
'Please enter' =>'Por favor introduza ', |
'months' => Array( |
'01'=>'Janeiro', |
'02'=>'Fevereiro', |
'03'=>'Março', |
'04'=>'Abril', |
'05'=>'Maio', |
'06'=>'Junho', |
'07'=>'Julho', |
'08'=>'Agosto', |
'09'=>'Setembro', |
'10'=>'Outubro', |
'11'=>'Novembro', |
'12'=>'Dezembro'), |
// phpMyEdit-report |
'Make report' => 'Criar relatório', |
'Select fields' => 'Escolher campos', |
'Records per screen' => 'Registos por ecran', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.CA.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: català |
* encoding: iso-8859-1 |
* date: 2006-04-06 |
* author: Josep Maria Faura <j.m.faura@telefonica.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.CA.inc,v 1.2 2006-04-11 10:30:46 nepto Exp $ */ |
return Array( |
'Add' =>'Afegir', |
'Copy' =>'Copiar', |
'Change' =>'Modificar', |
'Delete' =>'Suprimir', |
'View' =>'Visualitzar', |
'Prev' =>'Anterior', |
'Next' =>'Següent', |
'First' =>'Primer', |
'Last' =>'Últim', |
'Go to' =>'Ves a', |
'Page' =>'Pàgina', |
'Records' =>'Registres', |
'Save' =>'Salvar', |
'More' =>'Més', |
'Apply' =>'Aplicar', |
'Cancel' =>'Cancel·lar', |
'Search' =>'Cercar', |
'Hide' =>'Amagar', |
'Clear' =>'Netejar', |
'Query' =>'Consultar', |
'Current Query' =>'Consulta actual', |
'Sorted By' =>'Ordenat per', |
'ascending' =>'ascendent', |
'descending' =>'descendent', |
'hidden' =>'amagat', |
'of' =>'de', |
'record added' =>'Registre afegit', |
'record changed'=>'Registre modificat', |
'record deleted'=>'Registre esborrat', |
'Please enter' =>'Sisplau introdueixi ', |
'months' => Array( |
'01'=>'Gener', |
'02'=>'Febrer', |
'03'=>'Març', |
'04'=>'Abril', |
'05'=>'Maig', |
'06'=>'Juny', |
'07'=>'Juliol', |
'08'=>'Agost', |
'09'=>'Septembre', |
'10'=>'Octubre', |
'11'=>'Novembre', |
'12'=>'Desembre'), |
// phpMyEdit-report |
'Make report' => 'Construir informe', |
'Select fields' => 'Seleccionar camps', |
'Records per screen' => 'Registres per pantalla', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.PT-BR.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: portuguese (brazilian) |
* encoding: iso-8859-1 |
* date: 2002-12-23, 2003-01-14, 2003-05-17, 2004-01-21 |
* author: Roberto Cohen <roberto.cohen@fireman.com.br> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.PT-BR.inc,v 1.8 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Adiciona', |
'Copy' =>'Copia', |
'Change' =>'Edita', |
'Delete' =>'Remove', |
'View' =>'Visualiza', |
'Prev' =>'Anterior', |
'Next' =>'Próximo', |
'First' =>'Primeiro', |
'Last' =>'Último', |
'Go to' =>'Vai para', |
'Page' =>'Página', |
'Records' =>'Registros', |
'Save' =>'Salva', |
'More' =>'Mais', |
'Apply' =>'Aplica', |
'Cancel' =>'Cancela', |
'Search' =>'Pesquisa', |
'Hide' =>'Esconde', |
'Clear' =>'Limpa', |
'Query' =>'Resultado', |
'Current Query' =>'Resultado atual', |
'Sorted By' =>'Ordernado por', |
'ascending' =>'crescente', |
'descending' =>'descendente', |
'hidden' =>'escondido', |
'of' =>'de', |
'record added' =>'registro adicionado', |
'record changed'=>'registro editado', |
'record deleted'=>'registro removido', |
'Please enter' =>'Por favor, entre', |
'months' => Array( |
'01'=>'Janeiro', |
'02'=>'Fevereiro', |
'03'=>'Março', |
'04'=>'Abril', |
'05'=>'Maio', |
'06'=>'Junho', |
'07'=>'Julho', |
'08'=>'Agosto', |
'09'=>'Setembro', |
'10'=>'Outubro', |
'11'=>'Novembro', |
'12'=>'Dezembro'), |
// phpMyEdit-report |
'Gerar relatório' => 'Make report', |
'Selecionar campos' => 'Select fields', |
'Registros por tela' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.TR.inc |
---|
New file |
0,0 → 1,66 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: turkish |
* encoding: iso-8859-9 |
* date: 2003-10-24, 2005-11-13 |
* authors: |
* Nuri Akman <nuri.akman@hazine.gov.tr> |
* Kadan Kongar <kagan.kongar@tsrsb.org.tr> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.TR.inc,v 1.4 2005-11-14 03:15:04 nepto Exp $ */ |
return Array( |
'Add' =>'Ekle', |
'Copy' =>'Kopyala', |
'Change' =>'Deðiþtir', |
'Delete' =>'Sil', |
'View' =>'Bak', |
'Prev' =>'Önceki', |
'Next' =>'Sonraki', |
'First' =>'Ýlk', |
'Last' =>'Son', |
'Go to' =>'Git', |
'Page' =>'Sayfa', |
'Records' =>'Kayýt', |
'Save' =>'Kaydet', |
'More' =>'Devamý', |
'Apply' =>'Uygula', |
'Cancel' =>'Ýptal', |
'Search' =>'Ara', |
'Hide' =>'Gizle', |
'Clear' =>'Temizle', |
'Query' =>'Sorgu', |
'Current Query' =>'Aktif Sorgu', |
'Sorted By' =>'Sýralama', |
'ascending' =>'artan', |
'descending' =>'azalan', |
'hidden' =>'gizli', |
'of' =>' / ', |
'record added' =>'kayýt eklendi', |
'record changed' =>'kayýt deðiþtirildi', |
'record deleted' =>'kayýt silindi', |
'Please enter' =>'Lütfen giriniz :', |
'months' => Array( |
'01'=>'Ocak', |
'02'=>'Þubat', |
'03'=>'Mart', |
'04'=>'Nisan', |
'05'=>'Mayýs', |
'06'=>'Haziran', |
'07'=>'Temmuz', |
'08'=>'Auðustos', |
'09'=>'Eylül', |
'10'=>'Ekim', |
'11'=>'Kasým', |
'12'=>'Aralýk'), |
// phpMyEdit-report |
'Make report' => 'Rapor hazýrla', |
'Select fields' => 'Alanlarý seçiniz', |
'Records per screen' => 'Sayfa baþýna kayýt', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.RU.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: russian |
* encoding: windows-1251 |
* date: 2002-11-23 |
* author: Lev Zabudkin <zabudkin@mail.ru> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.RU.inc,v 1.11 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Äîáàâèòü', |
'Copy' =>'Êîïèðîâàòü', |
'Change' =>'Èçìåíèòü', |
'Delete' =>'Óäàëèòü', |
'View' =>'Ïðîñìîòð', |
'Prev' =>'<<', |
'Next' =>'>>', |
'First' =>'I<', |
'Last' =>'>I', |
'Go to' =>'Ïåðåéòè', |
'Page' =>'Ñòð.', |
'Records' =>'Çàïèñåé', |
'Save' =>'Ñîõðàíèòü', |
'More' =>'Áîëüøå', |
'Apply' =>'Ïðèìåíèòü', |
'Cancel' =>'Îòìåíà', |
'Search' =>'Ïîèñê', |
'Hide' =>'Ñêðûòü', |
'Clear' =>'Î÷èñòèòü', |
'Query' =>'Çàïðîñ', |
'Current Query' =>'Òåêóùèé çàïðîñ', |
'Sorted By' =>'Îòñîðòèðîâàíî ïî', |
'ascending' =>'- âîçðàñòàíèþ', |
'descending' =>'- óáûâàíèþ', |
'hidden' =>'ñêðûòî', |
'of' =>'èç', |
'record added' =>'çàïèñü äîáàâëåíà', |
'record changed'=>'çàïèñü îáíîâëåíà', |
'record deleted'=>'çàïèñü óäàëåíà', |
'Please enter' =>'Ïîæàëóéñòà ââåäèòå', |
'months' => Array( |
'01'=>'ßíâàðü', |
'02'=>'Ôåâðàëü', |
'03'=>'Ìàðò', |
'04'=>'Àïðåëü', |
'05'=>'Ìàé', |
'06'=>'Èþíü', |
'07'=>'Èþëü', |
'08'=>'Àâãóñò', |
'09'=>'Ñåíòÿáðü', |
'10'=>'Îêòÿáðü', |
'11'=>'Íîÿáðü', |
'12'=>'Äåêàáðü'), |
// phpMyEdit-report |
'Make report' => 'Ñîçäàòü îò÷åò', |
'Select fields' => 'Âûáðàòü ïîëÿ', |
'Records per screen' => 'Çàïèñåé íà ýêðàíå', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.EN-US.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: english (United States) |
* encoding: iso-8859-1 |
* date: 2002-02, 2003-05-01 |
* author: Jim Kraai <jkraai@users.sourceforge.net> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.EN-US.inc,v 1.10 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Add', |
'Copy' =>'Copy', |
'Change' =>'Change', |
'Delete' =>'Delete', |
'View' =>'View', |
'Prev' =>'Prev', |
'Next' =>'Next', |
'First' =>'First', |
'Last' =>'Last', |
'Go to' =>'Go to', |
'Page' =>'Page', |
'Records' =>'Records', |
'Save' =>'Save', |
'More' =>'More', |
'Apply' =>'Apply', |
'Cancel' =>'Cancel', |
'Search' =>'Search', |
'Hide' =>'Hide', |
'Clear' =>'Clear', |
'Query' =>'Query', |
'Current Query' =>'Current Query', |
'Sorted By' =>'Sorted By', |
'ascending' =>'ascending', |
'descending' =>'descending', |
'hidden' =>'hidden', |
'of' =>'of', |
'record added' =>'record added', |
'record changed' =>'record changed', |
'record deleted' =>'record deleted', |
'Please enter' =>'Please enter', |
'months' => Array( |
'01'=>'January', |
'02'=>'February', |
'03'=>'March', |
'04'=>'April', |
'05'=>'May', |
'06'=>'June', |
'07'=>'July', |
'08'=>'August', |
'09'=>'September', |
'10'=>'October', |
'11'=>'November', |
'12'=>'December'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.DE.inc |
---|
New file |
0,0 → 1,67 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: german (standard) |
* encoding: iso-8859-1 |
* date: 2002-07 |
* authors: |
* Christof Brandstetter <fellz@users.sourceforge.net> |
* Gerd Xhonneux, http://xsite.xhonneux.com |
* info: http://makeashorterlink.com/?O116223C2 |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.DE.inc,v 1.14 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Hinzufügen', |
'Copy' =>'Kopieren', |
'Change' =>'Ändern', |
'Delete' =>'Löschen', |
'View' =>'Anzeigen', |
'Prev' =>'Zurück', |
'Next' =>'Weiter', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'Seite', |
'Records' =>'Datensätze', |
'Save' =>'Speichern', |
'More' =>'Speichern, weiteren Datensatz hinzufügen', |
'Apply' =>'Anwenden', |
'Cancel' =>'Abbrechen', |
'Search' =>'Suche', |
'Hide' =>'Verstecken', |
'Clear' =>'Löschen', |
'Query' =>'Abfrage', |
'Current Query' =>'Aktuelle Abfrage', |
'Sorted By' =>'Sortiert nach', |
'ascending' =>'aufsteigend', |
'descending' =>'absteigend', |
'hidden' =>'versteckt', |
'of' =>'von', |
'record added' =>'Datensatz hinzugefügt', |
'record changed'=>'Datensatz geändert', |
'record deleted'=>'Datensatz gelöscht', |
'Please enter' =>'Bitte füllen sie dieses Feld aus:', |
'months' => Array( |
'01'=>'Januar', |
'02'=>'Februar', |
'03'=>'März', |
'04'=>'April', |
'05'=>'Mai', |
'06'=>'Juni', |
'07'=>'Juli', |
'08'=>'August', |
'09'=>'September', |
'10'=>'Oktober', |
'11'=>'November', |
'12'=>'Dezember'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ZH-SG.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: chinese (Singapore) |
* encoding: utf-8 |
* date: 2003-07-03 |
* author: Juraj Benadik <gastan at gastan.sk> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ZH-SG.inc,v 1.4 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'添加', |
'Copy' =>'复制', |
'Change' =>'更改', |
'Delete' =>'删除', |
'View' =>'查看', |
'Prev' =>'上页', |
'Next' =>'下页', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'页', |
'Records' =>'记录', |
'Save' =>'保存', |
'More' =>'更多', |
'Apply' =>'应用', |
'Cancel' =>'取消', |
'Search' =>'搜寻', |
'Hide' =>'隐藏', |
'Clear' =>'清除', |
'Query' =>'查询', |
'Current Query' =>'当前 查询', |
'Sorted By' =>'排序方式', |
'ascending' =>'上升', |
'descending' =>'递减', |
'hidden' =>'隐藏的', |
'of' =>'总', |
'record added' =>'记录添加', |
'record changed' =>'记录更改', |
'record deleted' =>'记录删除', |
'Please enter' =>'请进入', |
'months' => Array( |
'01'=>'一月', |
'02'=>'二月', |
'03'=>'三月', |
'04'=>'四月', |
'05'=>'五月', |
'06'=>'六月', |
'07'=>'七月', |
'08'=>'八月', |
'09'=>'九月', |
'10'=>'十月', |
'11'=>'十一月', |
'12'=>'十二月'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.ES-MX.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: spanish (mexican) |
* encoding: iso-8859-1 |
* date: 2003-04-30 |
* author: unknown |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.ES-MX.inc,v 1.3 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Agregar', |
'Copy' =>'Copiar', |
'Change' =>'Cambiar', |
'Delete' =>'Suprimir', |
'View' =>'Ver', |
'Prev' =>'Anterior', |
'Next' =>'Siguiente', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'Página', |
'Records' =>'Registros', |
'Save' =>'Guardar', |
'More' =>'Más', |
'Apply' =>'Aplicar', |
'Cancel' =>'Cancelar', |
'Search' =>'Buscar', |
'Hide' =>'Ocultar', |
'Clear' =>'Limpiar', |
'Query' =>'Consulta SQL', |
'Current Query' =>'Consulta actual', |
'Sorted By' =>'Ordenado por', |
'ascending' =>'ascendente', |
'descending' =>'descendente', |
'hidden' =>'oculto', |
'of' =>'de', |
'record added' =>'registro agregado', |
'record changed'=>'registro cambiado', |
'record deleted'=>'registro borrado', |
'Please enter' =>'Por favor introduzca ', |
'months' => Array( |
'01'=>'Enero', |
'02'=>'Febrero', |
'03'=>'Marzoa', |
'04'=>'Abril', |
'05'=>'Mayo', |
'06'=>'Junio', |
'07'=>'Julio', |
'08'=>'Agosto', |
'09'=>'Septiembre', |
'10'=>'Octubre', |
'11'=>'Noviembre', |
'12'=>'Diciembre'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/lang/PME.lang.DK.inc |
---|
New file |
0,0 → 1,64 |
<?php |
/* |
* phpMyEdit language file |
* |
* language: danish |
* encoding: iso-8859-1 |
* date: 2003-03-19 |
* author: Henrik Nielsen <kontakt@innovapage.dk> |
*/ |
/* $Platon: phpMyEdit/lang/PME.lang.DK.inc,v 1.5 2004-12-27 20:14:29 nepto Exp $ */ |
return Array( |
'Add' =>'Tilføj', |
'Copy' =>'Kopier', |
'Change' =>'Ret', |
'Delete' =>'Slet', |
'View' =>'Se', |
'Prev' =>'Tilbage', |
'Next' =>'Næste', |
'First' =>'First', // untranslated |
'Last' =>'Last', // untranslated |
'Go to' =>'Go to', // untranslated |
'Page' =>'Side', |
'Records' =>'Rækker', |
'Save' =>'Gem', |
'More' =>'Mere', |
'Apply' =>'Tilføj', |
'Cancel' =>'Fortryd', |
'Search' =>'Søg', |
'Hide' =>'Skjul', |
'Clear' =>'Tøm', |
'Query' =>'Søg', |
'Current Query' =>'Current Query', // untranslated |
'Sorted By' =>'Sorted By', // untranslated |
'ascending' =>'ascending', // untranslated |
'descending' =>'descending', // untranslated |
'hidden' =>'hidden', // untranslated |
'of' =>'af', |
'record added' =>'række tilføjet', |
'record changed' =>'række ændret', |
'record deleted' =>'række slettet', |
'Please enter' =>'Indtast venligst', |
'months' => Array( |
'01'=>'Januar', |
'02'=>'Februar', |
'03'=>'Marts', |
'04'=>'April', |
'05'=>'Maj', |
'06'=>'Juni', |
'07'=>'Juli', |
'08'=>'August', |
'09'=>'September', |
'10'=>'Oktober', |
'11'=>'November', |
'12'=>'December'), |
// phpMyEdit-report |
'Make report' => 'Make report', |
'Select fields' => 'Select fields', |
'Records per screen' => 'Records per screen', |
); |
?> |
/tags/v3.1-blanche-neige/jrest/util/images/pme-delete.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/pme-delete.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/pme-change.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/pme-change.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/pme-copy.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/pme-copy.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/pme-view.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/pme-view.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-copy.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-copy.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-view.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-view.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-delete.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-delete.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-change.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/tags/v3.1-blanche-neige/jrest/util/images/alt/pme-change.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/tags/v3.1-blanche-neige/jrest/util/cel_inventory.php |
---|
New file |
0,0 → 1,252 |
<style type="text/css"> |
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; } |
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; } |
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; } |
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0, |
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1, |
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; } |
td.pme-buttons { text-align: left; } |
td.pme-message { text-align: center; } |
td.pme-stats { text-align: right; } |
</style><?php |
/* |
* IMPORTANT NOTE: This generated file contains only a subset of huge amount |
* of options that can be used with phpMyEdit. To get information about all |
* features offered by phpMyEdit, check official documentation. It is available |
* online and also for download on phpMyEdit project management page: |
* |
* http://platon.sk/projects/main_page.php?project_id=5 |
* |
* This file was generated by: |
* |
* phpMyEdit version: 5.6 |
* phpMyEdit.class.php core class: 1.188 |
* phpMyEditSetup.php script: 1.48 |
* generating setup script: 1.48 |
*/ |
// MySQL host name, user name, password, database, and table |
$opts['hn'] = 'localhost'; |
$opts['un'] = 'root'; |
$opts['pw'] = ''; |
$opts['db'] = 'cel'; |
$opts['tb'] = 'cel_inventory'; |
// Name of field which is the unique key |
$opts['key'] = 'id'; |
// Type of key field (int/real/string/date etc.) |
$opts['key_type'] = 'int'; |
// Sorting field(s) |
$opts['sort_field'] = array('id'); |
// Number of records to display on the screen |
// Value of -1 lists all records in a table |
$opts['inc'] = 15; |
// Options you wish to give the users |
// A - add, C - change, P - copy, V - view, D - delete, |
// F - filter, I - initial sort suppressed |
$opts['options'] = 'ACPVDF'; |
// Number of lines to display on multiple selection filters |
$opts['multiple'] = '4'; |
// Navigation style: B - buttons (default), T - text links, G - graphic links |
// Buttons position: U - up, D - down (default) |
$opts['navigation'] = 'TB'; |
// Display special page elements |
$opts['display'] = array( |
'form' => true, |
'query' => true, |
'sort' => true, |
'time' => true, |
'tabs' => true |
); |
// Set default prefixes for variables |
$opts['js']['prefix'] = 'PME_js_'; |
$opts['dhtml']['prefix'] = 'PME_dhtml_'; |
$opts['cgi']['prefix']['operation'] = 'PME_op_'; |
$opts['cgi']['prefix']['sys'] = 'PME_sys_'; |
$opts['cgi']['prefix']['data'] = 'PME_data_'; |
/* Get the user's default language and use it if possible or you can |
specify particular one you want to use. Refer to official documentation |
for list of available languages. */ |
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE']; |
/* Table-level filter capability. If set, it is included in the WHERE clause |
of any generated SELECT statement in SQL query. This gives you ability to |
work only with subset of data from table. |
$opts['filters'] = "column1 like '%11%' AND column2<17"; |
$opts['filters'] = "section_id = 9"; |
$opts['filters'] = "PMEtable0.sessions_count > 200"; |
*/ |
/* Field definitions |
Fields will be displayed left to right on the screen in the order in which they |
appear in generated list. Here are some most used field options documented. |
['name'] is the title used for column headings, etc.; |
['maxlen'] maximum length to display add/edit/search input boxes |
['trimlen'] maximum length of string content to display in row listing |
['width'] is an optional display width specification for the column |
e.g. ['width'] = '100px'; |
['mask'] a string that is used by sprintf() to format field output |
['sort'] true or false; means the users may sort the display on this column |
['strip_tags'] true or false; whether to strip tags from content |
['nowrap'] true or false; whether this field should get a NOWRAP |
['select'] T - text, N - numeric, D - drop-down, M - multiple selection |
['options'] optional parameter to control whether a field is displayed |
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view |
Another flags are: |
R - indicates that a field is read only |
W - indicates that a field is a password field |
H - indicates that a field is to be hidden and marked as hidden |
['URL'] is used to make a field 'clickable' in the display |
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff'; |
['URLtarget'] HTML target link specification (for example: _blank) |
['textarea']['rows'] and/or ['textarea']['cols'] |
specifies a textarea is to be used to give multi-line input |
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10 |
['values'] restricts user input to the specified constants, |
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99) |
['values']['table'] and ['values']['column'] restricts user input |
to the values found in the specified column of another table |
['values']['description'] = 'desc_column' |
The optional ['values']['description'] field allows the value(s) displayed |
to the user to be different to those in the ['values']['column'] field. |
This is useful for giving more meaning to column values. Multiple |
descriptions fields are also possible. Check documentation for this. |
*/ |
$opts['fdd']['id'] = array( |
'name' => 'ID', |
'select' => 'T', |
'options' => 'AVCPDR', // auto increment |
'maxlen' => 20, |
'default' => '0', |
'sort' => true |
); |
$opts['fdd']['identifiant'] = array( |
'name' => 'Identifiant', |
'select' => 'T', |
'maxlen' => 128, |
'sort' => true |
); |
$opts['fdd']['ordre'] = array( |
'name' => 'Ordre', |
'select' => 'T', |
'maxlen' => 20, |
'sort' => true |
); |
$opts['fdd']['nom_sel'] = array( |
'name' => 'Nom sel', |
'select' => 'T', |
'maxlen' => 255, |
'sort' => true |
); |
$opts['fdd']['num_nom_sel'] = array( |
'name' => 'Num nom sel', |
'select' => 'T', |
'maxlen' => 11, |
'sort' => true |
); |
$opts['fdd']['nom_ret'] = array( |
'name' => 'Nom ret', |
'select' => 'T', |
'maxlen' => 255, |
'sort' => true |
); |
$opts['fdd']['num_nom_ret'] = array( |
'name' => 'Num nom ret', |
'select' => 'T', |
'maxlen' => 11, |
'sort' => true |
); |
$opts['fdd']['num_taxon'] = array( |
'name' => 'Num taxon', |
'select' => 'T', |
'maxlen' => 11, |
'sort' => true |
); |
$opts['fdd']['famille'] = array( |
'name' => 'Famille', |
'select' => 'T', |
'maxlen' => 255, |
'sort' => true |
); |
$opts['fdd']['location'] = array( |
'name' => 'Location', |
'select' => 'T', |
'maxlen' => 50, |
'sort' => true |
); |
$opts['fdd']['id_location'] = array( |
'name' => 'ID location', |
'select' => 'T', |
'maxlen' => 10, |
'sort' => true |
); |
$opts['fdd']['date_observation'] = array( |
'name' => 'Date observation', |
'select' => 'T', |
'maxlen' => 19, |
'sort' => true |
); |
$opts['fdd']['station'] = array( |
'name' => 'Station', |
'select' => 'T', |
'maxlen' => 255, |
'sort' => true |
); |
$opts['fdd']['milieu'] = array( |
'name' => 'Milieu', |
'select' => 'T', |
'maxlen' => 255, |
'sort' => true |
); |
$opts['fdd']['commentaire'] = array( |
'name' => 'Commentaire', |
'select' => 'T', |
'maxlen' => 1024, |
'sort' => true |
); |
$opts['fdd']['transmission'] = array( |
'name' => 'Transmission', |
'select' => 'T', |
'maxlen' => 4, |
'sort' => true |
); |
$opts['fdd']['date_creation'] = array( |
'name' => 'Date creation', |
'select' => 'T', |
'maxlen' => 19, |
'sort' => true |
); |
$opts['fdd']['date_modification'] = array( |
'name' => 'Date modification', |
'select' => 'T', |
'maxlen' => 19, |
'sort' => true |
); |
$opts['fdd']['date_transmission'] = array( |
'name' => 'Date transmission', |
'select' => 'T', |
'maxlen' => 19, |
'sort' => true |
); |
// Now important call to phpMyEdit |
require_once 'phpMyEdit.class.php'; |
new phpMyEdit($opts); |
?> |
/tags/v3.1-blanche-neige/jrest/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2010,5,25,17,12,16 |
[Settings] |
ShowDotFiles=true |
/tags/v3.1-blanche-neige/jrest/services/JRestService.php |
---|
New file |
0,0 → 1,238 |
<?php |
/** |
* Classe mère abstraite contenant les méthodes génériques des services. |
* Encodage en entrée : utf8 |
* Encodage en sortie : utf8 |
* |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt> |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt> |
* @version $Id$ |
* @copyright 2009 |
*/ |
abstract class JRestService { |
public $config; |
protected $bdd; |
protected $log = array(); |
protected $messages = array(); |
protected $debug = array(); |
protected $distinct = false; |
protected $orderby = null; |
protected $formatRetour = 'objet'; |
protected $start = 0; |
protected $limit = 150; |
public function __construct($config, $demarrer_session = true) { |
// Tableau contenant la config de Jrest |
$this->config = $config; |
// Connection à la base de données |
$this->bdd = $this->connecterPDO($this->config, 'appli'); |
// Nettoyage du $_GET (sécurité) |
if (isset($_GET)) { |
$get_params = array('orderby', 'distinct', 'start', 'limit', 'formatRetour'); |
foreach ($get_params as $get) { |
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';'); |
$_GET[$get] = str_replace($verifier, '', $_GET[$get]); |
if (isset($_GET[$get]) && $_GET[$get] != '') { |
$this->$get = $_GET[$get]; |
} else { |
$_GET[$get] = null; |
} |
} |
} |
} |
/** |
* Méthode appelée quand aucun paramètre n'est passé dans l'url et avec une requête de type GET. |
*/ |
public function getRessource() { |
$this->getElement(array()); |
} |
protected function envoyer($donnees = null, $mime = 'text/html', $encodage = 'utf-8', $json = true) { |
// Traitements des messages d'erreurs et données |
if (count($this->messages) != 0) { |
header('HTTP/1.1 500 Internal Server Error'); |
$mime = 'text/html'; |
$encodage = 'utf-8'; |
$json = true; |
$sortie = $this->messages; |
} else { |
$sortie = $donnees; |
if (is_null($donnees)) { |
$sortie = 'OK'; |
} |
} |
// Gestion de l'envoie du déboguage |
$this->envoyerDebogage(); |
// Encodage au format et JSON et envoie sur la sortie standard |
$contenu = $json ? json_encode($sortie) : $sortie; |
$this->envoyerContenu($encodage, $mime, $contenu); |
} |
protected function envoyerDebogage() { |
if (!is_array($this->debug)) { |
$this->debug[] = $this->debug; |
} |
if (count($this->debug) != 0) { |
foreach ($this->debug as $cle => $val) { |
if (is_array($val)) { |
$this->debug[$cle] = print_r($val, true); |
} |
} |
header('X-DebugJrest-Data:'.json_encode($this->debug)); |
} |
} |
protected function envoyerContenu($encodage, $mime, $contenu) { |
header("Content-Type: $mime; charset=$encodage"); |
print $contenu; |
} |
private function connecterPDO($config, $base = 'database') { |
$cfg = $config[$base]; |
$dsn = $cfg['phptype'].':dbname='.$cfg['database'].';host='.$cfg['hostspec']; |
try { |
$PDO = new PDO($dsn, $cfg['username'], $cfg['password']); |
} catch (PDOException $e) { |
echo 'La connexion à la base de donnée via PDO a échouée : ' . $e->getMessage(); |
} |
// Passe en UTF-8 la connexion à la BDD |
$PDO->exec("SET NAMES 'utf8'"); |
// Affiche les erreurs détectées par PDO (sinon mode silencieux => aucune erreur affiché) |
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
return $PDO; |
} |
protected function getTxt($id) { |
$sortie = ''; |
switch ($id) { |
case 'sql_erreur' : $sortie = 'Requête echec. Fichier : "%s". Ligne : "%s". Message : %s'; break; |
default : $sortie = $id; |
} |
return $sortie; |
} |
protected function traiterParametresUrl($params_attendu, $params, $pourBDD = true) { |
$sortie = array(); |
foreach ($params_attendu as $num => $nom) { |
if (isset($params[$num]) && $params[$num] != '*') { |
if ($pourBDD) { |
$params[$num] = $this->bdd->quote($params[$num]); |
} |
$sortie[$nom] = $params[$num]; |
} |
} |
return $sortie; |
} |
protected function traiterParametresPost($params) { |
$sortie = array(); |
foreach ($params as $cle => $valeur) { |
$sortie[$cle] = $this->bdd->quote($valeur); |
} |
return $sortie; |
} |
protected function getIdentification(&$params) { |
// Initialisation des variables |
$utilisateur = array(0, session_id()); |
// L'id utilisateur est soit passé par le POST soit dans l'url |
if (is_array($params) && isset($params['cmhl_ce_modifier_par'])) { |
$utilisateur[0] = $params['cmhl_ce_modifier_par']; |
unset($params['cmhl_ce_modifier_par']); |
} else if (is_string($params)) { |
$utilisateur[0] = $params; |
} |
return $utilisateur; |
} |
protected function etreAutorise($id_utilisateur) { |
$autorisation = false; |
if (($_SESSION['coel_utilisateur'] != '') && $_SESSION['coel_utilisateur']['id'] != $id_utilisateur) { |
$this->messages[] = 'Accès interdit.'; |
} else if ($_SESSION['coel_utilisateur'] == '') { |
$this->messages[] = 'Veuillez vous identifiez pour accéder à cette fonction.'; |
} else { |
$autorisation = true; |
} |
return $autorisation; |
} |
private function gererIdentificationPermanente() { |
// Pour maintenir l'utilisateur tjrs réellement identifié nous sommes obligé de recréer une SESSION et de le recharger depuis la bdd |
if ($this->getUtilisateur() == '' |
&& isset($_COOKIE['coel_login']) |
&& ($utilisateur = $this->chargerUtilisateur($_COOKIE['coel_login'], $_COOKIE['coel_mot_de_passe']))) { |
$this->setUtilisateur($utilisateur, $_COOKIE['coel_permanence']); |
} |
} |
protected function getUtilisateur() { |
return (isset($_SESSION['coel_utilisateur']) ? $_SESSION['coel_utilisateur'] : ''); |
} |
/** |
* Méthode prenant en paramètre un chemin de fichier squelette et un tableau associatif de données, |
* en extrait les variables, charge le squelette et retourne le résultat des deux combinés. |
* |
* @param String $fichier le chemin du fichier du squelette |
* @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette. |
* |
* @return boolean false si le squelette n'existe pas, sinon la chaine résultat. |
*/ |
public static function traiterSquelettePhp($fichier, Array $donnees = array()) { |
$sortie = false; |
if (file_exists($fichier)) { |
// Extraction des variables du tableau de données |
extract($donnees); |
// Démarage de la bufferisation de sortie |
ob_start(); |
// Si les tags courts sont activés |
if ((bool) @ini_get('short_open_tag') === true) { |
// Simple inclusion du squelette |
include $fichier; |
} else { |
// Sinon, remplacement des tags courts par la syntaxe classique avec echo |
$html_et_code_php = self::traiterTagsCourts($fichier); |
// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval |
$html_et_code_php = '?>'.$html_et_code_php; |
// Interprétation du html et du php dans le buffer |
echo eval($html_et_code_php); |
} |
// Récupèration du contenu du buffer |
$sortie = ob_get_contents(); |
// Suppression du buffer |
@ob_end_clean(); |
} else { |
$msg = "Le fichier du squelette '$fichier' n'existe pas."; |
trigger_error($msg, E_USER_WARNING); |
} |
// Retourne le contenu |
return $sortie; |
} |
/** |
* Fonction chargeant le contenu du squelette et remplaçant les tags court php (<?= ...) par un tag long avec echo. |
* |
* @param String $chemin_squelette le chemin du fichier du squelette |
* |
* @return string le contenu du fichier du squelette php avec les tags courts remplacés. |
*/ |
private static function traiterTagsCourts($chemin_squelette) { |
$contenu = file_get_contents($chemin_squelette); |
// Remplacement de tags courts par un tag long avec echo |
$contenu = str_replace('<?=', '<?php echo ', $contenu); |
// Ajout systématique d'un point virgule avant la fermeture php |
$contenu = preg_replace("/;*\s*\?>/", "; ?>", $contenu); |
return $contenu; |
} |
} |
?> |
/tags/v3.1-blanche-neige/jrest/services/squelettes/atom.tpl.xml |
---|
New file |
0,0 → 1,33 |
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?> |
<feed xmlns="http://www.w3.org/2005/Atom"> |
<title><?=$titre?></title> |
<link href="<?=$lien_coel?>" rel="alternate" type="text/html" hreflang="fr" /> |
<link href="<?=$lien_service?>" rel="self" type="application/atom+xml"/> |
<updated><?=$date_maj_ATOM?></updated> |
<author> |
<name><?=$editeur?></name> |
</author> |
<id><?=$guid?></id> |
<rights>Copyright (c) <?=$annee_courante?>, <?=$editeur?></rights> |
<generator uri="<?=$lien_coel?>" version="<?=$generateur_version?>"><?=$generateur?></generator> |
<?php if (isset($items)) : ?> |
<?php foreach ($items as $item) : ?> |
<entry> |
<id><?=$item['lien']?></id> |
<title><?=$item['titre']?></title> |
<link href="<?=$item['lien']?>"/> |
<updated><?=$item['date_maj_ATOM']?></updated> |
<author><name><?=$item['modifier_par']?></name></author> |
<content type="xhtml" xml:lang="fr"> |
<div xmlns="http://www.w3.org/1999/xhtml"> |
<?=$item['description'];?> |
</div> |
</content> |
</entry> |
<?php endforeach; ?> |
<?php endif; ?> |
</feed> |
/tags/v3.1-blanche-neige/jrest/services/squelettes/rss1.tpl.xml |
---|
New file |
0,0 → 1,45 |
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?> |
<!DOCTYPE rdf:RDF [ |
<!ENTITY % HTMLlat1 PUBLIC |
"-//W3C//ENTITIES Latin 1 for XHTML//EN" |
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> |
%HTMLlat1; |
]> |
<rdf:RDF |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
xmlns="http://purl.org/rss/1.0/"> |
<channel rdf:about="<?=$guid?>"> |
<title><?=$titre?></title> |
<link><?=$lien_coel?></link> |
<description><?=$description?></description> |
<dc:publisher><?=$editeur?></dc:publisher> |
<dc:date><?=$date_maj_W3C?></dc:date> |
<?php if (isset($items)) : ?> |
<items> |
<rdf:Seq> |
<?php foreach ($items as $item) : ?> |
<rdf:li resource="<?=$item['guid']?>" /> |
<?php endforeach; ?> |
</rdf:Seq> |
</items> |
<?php endif; ?> |
</channel> |
<?php if (isset($items)) : ?> |
<?php foreach ($items as $item) : ?> |
<item rdf:about="<?=$item['guid']?>"> |
<title><?=$item['titre']?></title> |
<link><?=$item['lien']?></link> |
<description><?=$item['description_encodee']?></description> |
<dc:date><?=$item['date_maj_W3C']?></dc:date> |
</item> |
<?php endforeach; ?> |
<?php endif; ?> |
</rdf:RDF> |
/tags/v3.1-blanche-neige/jrest/services/squelettes/rss2.tpl.xml |
---|
New file |
0,0 → 1,22 |
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?> |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
<channel> |
<title><?=$titre?></title> |
<link><?=$lien_coel?></link> |
<atom:link href="<?=$lien_service?>" rel="self" type="application/rss+xml" /> |
<description><?=$description?></description> |
<?php if (isset($items)) : ?> |
<?php foreach ($items as $item) : ?> |
<item> |
<guid><?=$item['guid']?></guid> |
<title><?=$item['titre']?></title> |
<link><?=$item['lien']?></link> |
<description><?=$item['description_encodee']?></description> |
<pubDate><?=$item['date_maj_RSS']?></pubDate> |
</item> |
<?php endforeach; ?> |
<?php endif; ?> |
</channel> |
</rss> |
/tags/v3.1-blanche-neige/jrest/services/squelettes/diff.tpl.html |
---|
New file |
0,0 → 1,36 |
<table style="border:1px solid black;border-collapse:collapse;" summary="Différences entre les données du <?=$date_ancienne?> et du <?=$date_nouvelle?>."> |
<caption style="text-align:left;font-weight:bold;">Différences</caption> |
<thead style="border:1px solid black;"> |
<tr> |
<th rowspan="2" style="border:1px dotted;">Champ</th> |
<th rowspan="2" style="border:1px dotted;">Type</th> |
<th <?=(($etat == 'M') ? 'colspan="2"' : '');?> style="border:1px dotted;">Valeur</th> |
</tr> |
<tr> |
<?php if ($etat == 'M') : ?> |
<th style="border:1px dotted;">Ancienne (<?=$date_ancienne?>)</th> |
<?php endif; ?> |
<th style="border:1px dotted;">Nouvelle (<?=$date_nouvelle?>)</th> |
</tr> |
</thead> |
<tbody> |
<?php foreach ($differences as $champ => $diff) : ?> |
<?php if ($diff['type'] == 'A') : |
$couleur = CFC; |
elseif ($diff['type'] == 'M') : |
$couleur = FFC; |
elseif ($diff['type'] == 'S') : |
$couleur = F99; |
endif; ?> |
<tr style="background-color:#<?=$couleur?>;"> |
<td style="border:1px dotted;"><?=$champ?></td> |
<td style="text-align:center;border:1px dotted;"><?=$diff['type_txt']?></td> |
<?php if ($etat == 'M') : ?> |
<td style="border:1px dotted;"><?=$diff['ancien']?></td> |
<?php endif; ?> |
<td style="border:1px dotted;"><?=$diff['nouveau']?></td> |
</tr> |
<?php endforeach; ?> |
</tbody> |
</table> |
/tags/v3.1-blanche-neige/jrest/services/.directory |
---|
New file |
0,0 → 1,5 |
[Dolphin] |
Timestamp=2010,5,25,17,11,22 |
[Settings] |
ShowDotFiles=true |
/tags/v3.1-blanche-neige/jrest/services/Resume.php |
---|
New file |
0,0 → 1,49 |
<?php |
/** |
* PHP Version 5 |
* |
* @category PHP |
* @package papyrus_bp |
* @author aurelien <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @version SVN: <svn_id> |
* @link /doc/papyrus_bp/ |
*/ |
Class Resume extends JRestService { |
public function getElement($uid){ |
$id_utilisateur = $uid[0]; |
$mail_utilisateur = $uid[1]; |
$sql= 'SELECT bf_id_fiche, bf_titre, bf_date_maj_fiche FROM bazar_fiche'. |
' WHERE bf_ce_utilisateur = '.$id_utilisateur. |
' AND bf_statut_fiche = 1'. |
' ORDER BY bf_date_maj_fiche DESC '. |
' LIMIT 0,5'; |
$fiches = $projets = $this->bdd->query($sql)->fetchAll(); |
$resume = array(); |
$resume['titre'] = 'Mes derniers événements publiés'; |
$resume['lien_appli'] = '<a href="http://www.tela-botanica.org/page:evenements" > Consulter tous les évenements </a>'; |
if(!$fiches) { |
$resume['message'] = 'Aucune fiche saisie pour le moment'; |
} else { |
foreach($fiches as $fiche) { |
$cible_lien = 'http://www.tela-botanica.org/page:evenements?vue=1&action=8&id_fiche='.$fiche['bf_id_fiche']; |
$date_pub = ' publiée le '.$fiche['bf_date_maj_fiche']; |
$resume_item = array('element' => htmlspecialchars($fiche['bf_titre']).$date_pub, 'lien' => $cible_lien); |
$resume['elements'][] = $resume_item; |
} |
} |
$this->envoyer($resume); |
} |
} |
?> |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/helvetica.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['helvetica'] = array( |
chr(0) => 278, |
chr(1) => 278, |
chr(2) => 278, |
chr(3) => 278, |
chr(4) => 278, |
chr(5) => 278, |
chr(6) => 278, |
chr(7) => 278, |
chr(8) => 278, |
chr(9) => 278, |
chr(10) => 278, |
chr(11) => 278, |
chr(12) => 278, |
chr(13) => 278, |
chr(14) => 278, |
chr(15) => 278, |
chr(16) => 278, |
chr(17) => 278, |
chr(18) => 278, |
chr(19) => 278, |
chr(20) => 278, |
chr(21) => 278, |
chr(22) => 278, |
chr(23) => 278, |
chr(24) => 278, |
chr(25) => 278, |
chr(26) => 278, |
chr(27) => 278, |
chr(28) => 278, |
chr(29) => 278, |
chr(30) => 278, |
chr(31) => 278, |
' ' => 278, |
'!' => 278, |
'"' => 355, |
'#' => 556, |
'$' => 556, |
'%' => 889, |
'&' => 667, |
'\'' => 191, |
'(' => 333, |
')' => 333, |
'*' => 389, |
'+' => 584, |
',' => 278, |
'-' => 333, |
'.' => 278, |
'/' => 278, |
'0' => 556, |
'1' => 556, |
'2' => 556, |
'3' => 556, |
'4' => 556, |
'5' => 556, |
'6' => 556, |
'7' => 556, |
'8' => 556, |
'9' => 556, |
':' => 278, |
';' => 278, |
'<' => 584, |
'=' => 584, |
'>' => 584, |
'?' => 556, |
'@' => 1015, |
'A' => 667, |
'B' => 667, |
'C' => 722, |
'D' => 722, |
'E' => 667, |
'F' => 611, |
'G' => 778, |
'H' => 722, |
'I' => 278, |
'J' => 500, |
'K' => 667, |
'L' => 556, |
'M' => 833, |
'N' => 722, |
'O' => 778, |
'P' => 667, |
'Q' => 778, |
'R' => 722, |
'S' => 667, |
'T' => 611, |
'U' => 722, |
'V' => 667, |
'W' => 944, |
'X' => 667, |
'Y' => 667, |
'Z' => 611, |
'[' => 278, |
'\\' => 278, |
']' => 278, |
'^' => 469, |
'_' => 556, |
'`' => 333, |
'a' => 556, |
'b' => 556, |
'c' => 500, |
'd' => 556, |
'e' => 556, |
'f' => 278, |
'g' => 556, |
'h' => 556, |
'i' => 222, |
'j' => 222, |
'k' => 500, |
'l' => 222, |
'm' => 833, |
'n' => 556, |
'o' => 556, |
'p' => 556, |
'q' => 556, |
'r' => 333, |
's' => 500, |
't' => 278, |
'u' => 556, |
'v' => 500, |
'w' => 722, |
'x' => 500, |
'y' => 500, |
'z' => 500, |
'{' => 334, |
'|' => 260, |
'}' => 334, |
'~' => 584, |
chr(127) => 350, |
chr(128) => 556, |
chr(129) => 350, |
chr(130) => 222, |
chr(131) => 556, |
chr(132) => 333, |
chr(133) => 1000, |
chr(134) => 556, |
chr(135) => 556, |
chr(136) => 333, |
chr(137) => 1000, |
chr(138) => 667, |
chr(139) => 333, |
chr(140) => 1000, |
chr(141) => 350, |
chr(142) => 611, |
chr(143) => 350, |
chr(144) => 350, |
chr(145) => 222, |
chr(146) => 222, |
chr(147) => 333, |
chr(148) => 333, |
chr(149) => 350, |
chr(150) => 556, |
chr(151) => 1000, |
chr(152) => 333, |
chr(153) => 1000, |
chr(154) => 500, |
chr(155) => 333, |
chr(156) => 944, |
chr(157) => 350, |
chr(158) => 500, |
chr(159) => 667, |
chr(160) => 278, |
chr(161) => 333, |
chr(162) => 556, |
chr(163) => 556, |
chr(164) => 556, |
chr(165) => 556, |
chr(166) => 260, |
chr(167) => 556, |
chr(168) => 333, |
chr(169) => 737, |
chr(170) => 370, |
chr(171) => 556, |
chr(172) => 584, |
chr(173) => 333, |
chr(174) => 737, |
chr(175) => 333, |
chr(176) => 400, |
chr(177) => 584, |
chr(178) => 333, |
chr(179) => 333, |
chr(180) => 333, |
chr(181) => 556, |
chr(182) => 537, |
chr(183) => 278, |
chr(184) => 333, |
chr(185) => 333, |
chr(186) => 365, |
chr(187) => 556, |
chr(188) => 834, |
chr(189) => 834, |
chr(190) => 834, |
chr(191) => 611, |
chr(192) => 667, |
chr(193) => 667, |
chr(194) => 667, |
chr(195) => 667, |
chr(196) => 667, |
chr(197) => 667, |
chr(198) => 1000, |
chr(199) => 722, |
chr(200) => 667, |
chr(201) => 667, |
chr(202) => 667, |
chr(203) => 667, |
chr(204) => 278, |
chr(205) => 278, |
chr(206) => 278, |
chr(207) => 278, |
chr(208) => 722, |
chr(209) => 722, |
chr(210) => 778, |
chr(211) => 778, |
chr(212) => 778, |
chr(213) => 778, |
chr(214) => 778, |
chr(215) => 584, |
chr(216) => 778, |
chr(217) => 722, |
chr(218) => 722, |
chr(219) => 722, |
chr(220) => 722, |
chr(221) => 667, |
chr(222) => 667, |
chr(223) => 611, |
chr(224) => 556, |
chr(225) => 556, |
chr(226) => 556, |
chr(227) => 556, |
chr(228) => 556, |
chr(229) => 556, |
chr(230) => 889, |
chr(231) => 500, |
chr(232) => 556, |
chr(233) => 556, |
chr(234) => 556, |
chr(235) => 556, |
chr(236) => 278, |
chr(237) => 278, |
chr(238) => 278, |
chr(239) => 278, |
chr(240) => 556, |
chr(241) => 556, |
chr(242) => 556, |
chr(243) => 556, |
chr(244) => 556, |
chr(245) => 556, |
chr(246) => 556, |
chr(247) => 584, |
chr(248) => 611, |
chr(249) => 556, |
chr(250) => 556, |
chr(251) => 556, |
chr(252) => 556, |
chr(253) => 500, |
chr(254) => 556, |
chr(255) => 500); |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/symbol.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['symbol'] = array( |
chr(0) => 250, |
chr(1) => 250, |
chr(2) => 250, |
chr(3) => 250, |
chr(4) => 250, |
chr(5) => 250, |
chr(6) => 250, |
chr(7) => 250, |
chr(8) => 250, |
chr(9) => 250, |
chr(10) => 250, |
chr(11) => 250, |
chr(12) => 250, |
chr(13) => 250, |
chr(14) => 250, |
chr(15) => 250, |
chr(16) => 250, |
chr(17) => 250, |
chr(18) => 250, |
chr(19) => 250, |
chr(20) => 250, |
chr(21) => 250, |
chr(22) => 250, |
chr(23) => 250, |
chr(24) => 250, |
chr(25) => 250, |
chr(26) => 250, |
chr(27) => 250, |
chr(28) => 250, |
chr(29) => 250, |
chr(30) => 250, |
chr(31) => 250, |
' ' => 250, |
'!' => 333, |
'"' => 713, |
'#' => 500, |
'$' => 549, |
'%' => 833, |
'&' => 778, |
'\'' => 439, |
'(' => 333, |
')' => 333, |
'*' => 500, |
'+' => 549, |
',' => 250, |
'-' => 549, |
'.' => 250, |
'/' => 278, |
'0' => 500, |
'1' => 500, |
'2' => 500, |
'3' => 500, |
'4' => 500, |
'5' => 500, |
'6' => 500, |
'7' => 500, |
'8' => 500, |
'9' => 500, |
':' => 278, |
';' => 278, |
'<' => 549, |
'=' => 549, |
'>' => 549, |
'?' => 444, |
'@' => 549, |
'A' => 722, |
'B' => 667, |
'C' => 722, |
'D' => 612, |
'E' => 611, |
'F' => 763, |
'G' => 603, |
'H' => 722, |
'I' => 333, |
'J' => 631, |
'K' => 722, |
'L' => 686, |
'M' => 889, |
'N' => 722, |
'O' => 722, |
'P' => 768, |
'Q' => 741, |
'R' => 556, |
'S' => 592, |
'T' => 611, |
'U' => 690, |
'V' => 439, |
'W' => 768, |
'X' => 645, |
'Y' => 795, |
'Z' => 611, |
'[' => 333, |
'\\' => 863, |
']' => 333, |
'^' => 658, |
'_' => 500, |
'`' => 500, |
'a' => 631, |
'b' => 549, |
'c' => 549, |
'd' => 494, |
'e' => 439, |
'f' => 521, |
'g' => 411, |
'h' => 603, |
'i' => 329, |
'j' => 603, |
'k' => 549, |
'l' => 549, |
'm' => 576, |
'n' => 521, |
'o' => 549, |
'p' => 549, |
'q' => 521, |
'r' => 549, |
's' => 603, |
't' => 439, |
'u' => 576, |
'v' => 713, |
'w' => 686, |
'x' => 493, |
'y' => 686, |
'z' => 494, |
'{' => 480, |
'|' => 200, |
'}' => 480, |
'~' => 549, |
chr(127) => 0, |
chr(128) => 0, |
chr(129) => 0, |
chr(130) => 0, |
chr(131) => 0, |
chr(132) => 0, |
chr(133) => 0, |
chr(134) => 0, |
chr(135) => 0, |
chr(136) => 0, |
chr(137) => 0, |
chr(138) => 0, |
chr(139) => 0, |
chr(140) => 0, |
chr(141) => 0, |
chr(142) => 0, |
chr(143) => 0, |
chr(144) => 0, |
chr(145) => 0, |
chr(146) => 0, |
chr(147) => 0, |
chr(148) => 0, |
chr(149) => 0, |
chr(150) => 0, |
chr(151) => 0, |
chr(152) => 0, |
chr(153) => 0, |
chr(154) => 0, |
chr(155) => 0, |
chr(156) => 0, |
chr(157) => 0, |
chr(158) => 0, |
chr(159) => 0, |
chr(160) => 750, |
chr(161) => 620, |
chr(162) => 247, |
chr(163) => 549, |
chr(164) => 167, |
chr(165) => 713, |
chr(166) => 500, |
chr(167) => 753, |
chr(168) => 753, |
chr(169) => 753, |
chr(170) => 753, |
chr(171) => 1042, |
chr(172) => 987, |
chr(173) => 603, |
chr(174) => 987, |
chr(175) => 603, |
chr(176) => 400, |
chr(177) => 549, |
chr(178) => 411, |
chr(179) => 549, |
chr(180) => 549, |
chr(181) => 713, |
chr(182) => 494, |
chr(183) => 460, |
chr(184) => 549, |
chr(185) => 549, |
chr(186) => 549, |
chr(187) => 549, |
chr(188) => 1000, |
chr(189) => 603, |
chr(190) => 1000, |
chr(191) => 658, |
chr(192) => 823, |
chr(193) => 686, |
chr(194) => 795, |
chr(195) => 987, |
chr(196) => 768, |
chr(197) => 768, |
chr(198) => 823, |
chr(199) => 768, |
chr(200) => 768, |
chr(201) => 713, |
chr(202) => 713, |
chr(203) => 713, |
chr(204) => 713, |
chr(205) => 713, |
chr(206) => 713, |
chr(207) => 713, |
chr(208) => 768, |
chr(209) => 713, |
chr(210) => 790, |
chr(211) => 790, |
chr(212) => 890, |
chr(213) => 823, |
chr(214) => 549, |
chr(215) => 250, |
chr(216) => 713, |
chr(217) => 603, |
chr(218) => 603, |
chr(219) => 1042, |
chr(220) => 987, |
chr(221) => 603, |
chr(222) => 987, |
chr(223) => 603, |
chr(224) => 494, |
chr(225) => 329, |
chr(226) => 790, |
chr(227) => 790, |
chr(228) => 786, |
chr(229) => 713, |
chr(230) => 384, |
chr(231) => 384, |
chr(232) => 384, |
chr(233) => 384, |
chr(234) => 384, |
chr(235) => 384, |
chr(236) => 494, |
chr(237) => 494, |
chr(238) => 494, |
chr(239) => 494, |
chr(240) => 0, |
chr(241) => 329, |
chr(242) => 274, |
chr(243) => 686, |
chr(244) => 686, |
chr(245) => 686, |
chr(246) => 384, |
chr(247) => 384, |
chr(248) => 384, |
chr(249) => 384, |
chr(250) => 384, |
chr(251) => 384, |
chr(252) => 494, |
chr(253) => 494, |
chr(254) => 494, |
chr(255) => 0); |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/helveticab.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['helveticaB'] = array( |
chr(0) => 278, |
chr(1) => 278, |
chr(2) => 278, |
chr(3) => 278, |
chr(4) => 278, |
chr(5) => 278, |
chr(6) => 278, |
chr(7) => 278, |
chr(8) => 278, |
chr(9) => 278, |
chr(10) => 278, |
chr(11) => 278, |
chr(12) => 278, |
chr(13) => 278, |
chr(14) => 278, |
chr(15) => 278, |
chr(16) => 278, |
chr(17) => 278, |
chr(18) => 278, |
chr(19) => 278, |
chr(20) => 278, |
chr(21) => 278, |
chr(22) => 278, |
chr(23) => 278, |
chr(24) => 278, |
chr(25) => 278, |
chr(26) => 278, |
chr(27) => 278, |
chr(28) => 278, |
chr(29) => 278, |
chr(30) => 278, |
chr(31) => 278, |
' ' => 278, |
'!' => 333, |
'"' => 474, |
'#' => 556, |
'$' => 556, |
'%' => 889, |
'&' => 722, |
'\'' => 238, |
'(' => 333, |
')' => 333, |
'*' => 389, |
'+' => 584, |
',' => 278, |
'-' => 333, |
'.' => 278, |
'/' => 278, |
'0' => 556, |
'1' => 556, |
'2' => 556, |
'3' => 556, |
'4' => 556, |
'5' => 556, |
'6' => 556, |
'7' => 556, |
'8' => 556, |
'9' => 556, |
':' => 333, |
';' => 333, |
'<' => 584, |
'=' => 584, |
'>' => 584, |
'?' => 611, |
'@' => 975, |
'A' => 722, |
'B' => 722, |
'C' => 722, |
'D' => 722, |
'E' => 667, |
'F' => 611, |
'G' => 778, |
'H' => 722, |
'I' => 278, |
'J' => 556, |
'K' => 722, |
'L' => 611, |
'M' => 833, |
'N' => 722, |
'O' => 778, |
'P' => 667, |
'Q' => 778, |
'R' => 722, |
'S' => 667, |
'T' => 611, |
'U' => 722, |
'V' => 667, |
'W' => 944, |
'X' => 667, |
'Y' => 667, |
'Z' => 611, |
'[' => 333, |
'\\' => 278, |
']' => 333, |
'^' => 584, |
'_' => 556, |
'`' => 333, |
'a' => 556, |
'b' => 611, |
'c' => 556, |
'd' => 611, |
'e' => 556, |
'f' => 333, |
'g' => 611, |
'h' => 611, |
'i' => 278, |
'j' => 278, |
'k' => 556, |
'l' => 278, |
'm' => 889, |
'n' => 611, |
'o' => 611, |
'p' => 611, |
'q' => 611, |
'r' => 389, |
's' => 556, |
't' => 333, |
'u' => 611, |
'v' => 556, |
'w' => 778, |
'x' => 556, |
'y' => 556, |
'z' => 500, |
'{' => 389, |
'|' => 280, |
'}' => 389, |
'~' => 584, |
chr(127) => 350, |
chr(128) => 556, |
chr(129) => 350, |
chr(130) => 278, |
chr(131) => 556, |
chr(132) => 500, |
chr(133) => 1000, |
chr(134) => 556, |
chr(135) => 556, |
chr(136) => 333, |
chr(137) => 1000, |
chr(138) => 667, |
chr(139) => 333, |
chr(140) => 1000, |
chr(141) => 350, |
chr(142) => 611, |
chr(143) => 350, |
chr(144) => 350, |
chr(145) => 278, |
chr(146) => 278, |
chr(147) => 500, |
chr(148) => 500, |
chr(149) => 350, |
chr(150) => 556, |
chr(151) => 1000, |
chr(152) => 333, |
chr(153) => 1000, |
chr(154) => 556, |
chr(155) => 333, |
chr(156) => 944, |
chr(157) => 350, |
chr(158) => 500, |
chr(159) => 667, |
chr(160) => 278, |
chr(161) => 333, |
chr(162) => 556, |
chr(163) => 556, |
chr(164) => 556, |
chr(165) => 556, |
chr(166) => 280, |
chr(167) => 556, |
chr(168) => 333, |
chr(169) => 737, |
chr(170) => 370, |
chr(171) => 556, |
chr(172) => 584, |
chr(173) => 333, |
chr(174) => 737, |
chr(175) => 333, |
chr(176) => 400, |
chr(177) => 584, |
chr(178) => 333, |
chr(179) => 333, |
chr(180) => 333, |
chr(181) => 611, |
chr(182) => 556, |
chr(183) => 278, |
chr(184) => 333, |
chr(185) => 333, |
chr(186) => 365, |
chr(187) => 556, |
chr(188) => 834, |
chr(189) => 834, |
chr(190) => 834, |
chr(191) => 611, |
chr(192) => 722, |
chr(193) => 722, |
chr(194) => 722, |
chr(195) => 722, |
chr(196) => 722, |
chr(197) => 722, |
chr(198) => 1000, |
chr(199) => 722, |
chr(200) => 667, |
chr(201) => 667, |
chr(202) => 667, |
chr(203) => 667, |
chr(204) => 278, |
chr(205) => 278, |
chr(206) => 278, |
chr(207) => 278, |
chr(208) => 722, |
chr(209) => 722, |
chr(210) => 778, |
chr(211) => 778, |
chr(212) => 778, |
chr(213) => 778, |
chr(214) => 778, |
chr(215) => 584, |
chr(216) => 778, |
chr(217) => 722, |
chr(218) => 722, |
chr(219) => 722, |
chr(220) => 722, |
chr(221) => 667, |
chr(222) => 667, |
chr(223) => 611, |
chr(224) => 556, |
chr(225) => 556, |
chr(226) => 556, |
chr(227) => 556, |
chr(228) => 556, |
chr(229) => 556, |
chr(230) => 889, |
chr(231) => 556, |
chr(232) => 556, |
chr(233) => 556, |
chr(234) => 556, |
chr(235) => 556, |
chr(236) => 278, |
chr(237) => 278, |
chr(238) => 278, |
chr(239) => 278, |
chr(240) => 611, |
chr(241) => 611, |
chr(242) => 611, |
chr(243) => 611, |
chr(244) => 611, |
chr(245) => 611, |
chr(246) => 611, |
chr(247) => 584, |
chr(248) => 611, |
chr(249) => 611, |
chr(250) => 611, |
chr(251) => 611, |
chr(252) => 611, |
chr(253) => 556, |
chr(254) => 611, |
chr(255) => 556); |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/courier.php |
---|
New file |
0,0 → 1,10 |
<?php |
/** |
* @package File_PDF |
*/ |
for ($i = 0; $i <= 255; $i++) { |
$font_widths['courier'][chr($i)] = 600; |
} |
$font_widths['courierB'] = $font_widths['courier']; |
$font_widths['courierI'] = $font_widths['courier']; |
$font_widths['courierBI'] = $font_widths['courier']; |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/timesi.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['timesI'] = array( |
chr(0) => 250, |
chr(1) => 250, |
chr(2) => 250, |
chr(3) => 250, |
chr(4) => 250, |
chr(5) => 250, |
chr(6) => 250, |
chr(7) => 250, |
chr(8) => 250, |
chr(9) => 250, |
chr(10) => 250, |
chr(11) => 250, |
chr(12) => 250, |
chr(13) => 250, |
chr(14) => 250, |
chr(15) => 250, |
chr(16) => 250, |
chr(17) => 250, |
chr(18) => 250, |
chr(19) => 250, |
chr(20) => 250, |
chr(21) => 250, |
chr(22) => 250, |
chr(23) => 250, |
chr(24) => 250, |
chr(25) => 250, |
chr(26) => 250, |
chr(27) => 250, |
chr(28) => 250, |
chr(29) => 250, |
chr(30) => 250, |
chr(31) => 250, |
' ' => 250, |
'!' => 333, |
'"' => 420, |
'#' => 500, |
'$' => 500, |
'%' => 833, |
'&' => 778, |
'\'' => 214, |
'(' => 333, |
')' => 333, |
'*' => 500, |
'+' => 675, |
',' => 250, |
'-' => 333, |
'.' => 250, |
'/' => 278, |
'0' => 500, |
'1' => 500, |
'2' => 500, |
'3' => 500, |
'4' => 500, |
'5' => 500, |
'6' => 500, |
'7' => 500, |
'8' => 500, |
'9' => 500, |
':' => 333, |
';' => 333, |
'<' => 675, |
'=' => 675, |
'>' => 675, |
'?' => 500, |
'@' => 920, |
'A' => 611, |
'B' => 611, |
'C' => 667, |
'D' => 722, |
'E' => 611, |
'F' => 611, |
'G' => 722, |
'H' => 722, |
'I' => 333, |
'J' => 444, |
'K' => 667, |
'L' => 556, |
'M' => 833, |
'N' => 667, |
'O' => 722, |
'P' => 611, |
'Q' => 722, |
'R' => 611, |
'S' => 500, |
'T' => 556, |
'U' => 722, |
'V' => 611, |
'W' => 833, |
'X' => 611, |
'Y' => 556, |
'Z' => 556, |
'[' => 389, |
'\\' => 278, |
']' => 389, |
'^' => 422, |
'_' => 500, |
'`' => 333, |
'a' => 500, |
'b' => 500, |
'c' => 444, |
'd' => 500, |
'e' => 444, |
'f' => 278, |
'g' => 500, |
'h' => 500, |
'i' => 278, |
'j' => 278, |
'k' => 444, |
'l' => 278, |
'm' => 722, |
'n' => 500, |
'o' => 500, |
'p' => 500, |
'q' => 500, |
'r' => 389, |
's' => 389, |
't' => 278, |
'u' => 500, |
'v' => 444, |
'w' => 667, |
'x' => 444, |
'y' => 444, |
'z' => 389, |
'{' => 400, |
'|' => 275, |
'}' => 400, |
'~' => 541, |
chr(127) => 350, |
chr(128) => 500, |
chr(129) => 350, |
chr(130) => 333, |
chr(131) => 500, |
chr(132) => 556, |
chr(133) => 889, |
chr(134) => 500, |
chr(135) => 500, |
chr(136) => 333, |
chr(137) => 1000, |
chr(138) => 500, |
chr(139) => 333, |
chr(140) => 944, |
chr(141) => 350, |
chr(142) => 556, |
chr(143) => 350, |
chr(144) => 350, |
chr(145) => 333, |
chr(146) => 333, |
chr(147) => 556, |
chr(148) => 556, |
chr(149) => 350, |
chr(150) => 500, |
chr(151) => 889, |
chr(152) => 333, |
chr(153) => 980, |
chr(154) => 389, |
chr(155) => 333, |
chr(156) => 667, |
chr(157) => 350, |
chr(158) => 389, |
chr(159) => 556, |
chr(160) => 250, |
chr(161) => 389, |
chr(162) => 500, |
chr(163) => 500, |
chr(164) => 500, |
chr(165) => 500, |
chr(166) => 275, |
chr(167) => 500, |
chr(168) => 333, |
chr(169) => 760, |
chr(170) => 276, |
chr(171) => 500, |
chr(172) => 675, |
chr(173) => 333, |
chr(174) => 760, |
chr(175) => 333, |
chr(176) => 400, |
chr(177) => 675, |
chr(178) => 300, |
chr(179) => 300, |
chr(180) => 333, |
chr(181) => 500, |
chr(182) => 523, |
chr(183) => 250, |
chr(184) => 333, |
chr(185) => 300, |
chr(186) => 310, |
chr(187) => 500, |
chr(188) => 750, |
chr(189) => 750, |
chr(190) => 750, |
chr(191) => 500, |
chr(192) => 611, |
chr(193) => 611, |
chr(194) => 611, |
chr(195) => 611, |
chr(196) => 611, |
chr(197) => 611, |
chr(198) => 889, |
chr(199) => 667, |
chr(200) => 611, |
chr(201) => 611, |
chr(202) => 611, |
chr(203) => 611, |
chr(204) => 333, |
chr(205) => 333, |
chr(206) => 333, |
chr(207) => 333, |
chr(208) => 722, |
chr(209) => 667, |
chr(210) => 722, |
chr(211) => 722, |
chr(212) => 722, |
chr(213) => 722, |
chr(214) => 722, |
chr(215) => 675, |
chr(216) => 722, |
chr(217) => 722, |
chr(218) => 722, |
chr(219) => 722, |
chr(220) => 722, |
chr(221) => 556, |
chr(222) => 611, |
chr(223) => 500, |
chr(224) => 500, |
chr(225) => 500, |
chr(226) => 500, |
chr(227) => 500, |
chr(228) => 500, |
chr(229) => 500, |
chr(230) => 667, |
chr(231) => 444, |
chr(232) => 444, |
chr(233) => 444, |
chr(234) => 444, |
chr(235) => 444, |
chr(236) => 278, |
chr(237) => 278, |
chr(238) => 278, |
chr(239) => 278, |
chr(240) => 500, |
chr(241) => 500, |
chr(242) => 500, |
chr(243) => 500, |
chr(244) => 500, |
chr(245) => 500, |
chr(246) => 500, |
chr(247) => 675, |
chr(248) => 500, |
chr(249) => 500, |
chr(250) => 500, |
chr(251) => 500, |
chr(252) => 500, |
chr(253) => 444, |
chr(254) => 500, |
chr(255) => 444); |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/timesbi.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['timesBI'] = array( |
chr(0) => 250, |
chr(1) => 250, |
chr(2) => 250, |
chr(3) => 250, |
chr(4) => 250, |
chr(5) => 250, |
chr(6) => 250, |
chr(7) => 250, |
chr(8) => 250, |
chr(9) => 250, |
chr(10) => 250, |
chr(11) => 250, |
chr(12) => 250, |
chr(13) => 250, |
chr(14) => 250, |
chr(15) => 250, |
chr(16) => 250, |
chr(17) => 250, |
chr(18) => 250, |
chr(19) => 250, |
chr(20) => 250, |
chr(21) => 250, |
chr(22) => 250, |
chr(23) => 250, |
chr(24) => 250, |
chr(25) => 250, |
chr(26) => 250, |
chr(27) => 250, |
chr(28) => 250, |
chr(29) => 250, |
chr(30) => 250, |
chr(31) => 250, |
' ' => 250, |
'!' => 389, |
'"' => 555, |
'#' => 500, |
'$' => 500, |
'%' => 833, |
'&' => 778, |
'\'' => 278, |
'(' => 333, |
')' => 333, |
'*' => 500, |
'+' => 570, |
',' => 250, |
'-' => 333, |
'.' => 250, |
'/' => 278, |
'0' => 500, |
'1' => 500, |
'2' => 500, |
'3' => 500, |
'4' => 500, |
'5' => 500, |
'6' => 500, |
'7' => 500, |
'8' => 500, |
'9' => 500, |
':' => 333, |
';' => 333, |
'<' => 570, |
'=' => 570, |
'>' => 570, |
'?' => 500, |
'@' => 832, |
'A' => 667, |
'B' => 667, |
'C' => 667, |
'D' => 722, |
'E' => 667, |
'F' => 667, |
'G' => 722, |
'H' => 778, |
'I' => 389, |
'J' => 500, |
'K' => 667, |
'L' => 611, |
'M' => 889, |
'N' => 722, |
'O' => 722, |
'P' => 611, |
'Q' => 722, |
'R' => 667, |
'S' => 556, |
'T' => 611, |
'U' => 722, |
'V' => 667, |
'W' => 889, |
'X' => 667, |
'Y' => 611, |
'Z' => 611, |
'[' => 333, |
'\\' => 278, |
']' => 333, |
'^' => 570, |
'_' => 500, |
'`' => 333, |
'a' => 500, |
'b' => 500, |
'c' => 444, |
'd' => 500, |
'e' => 444, |
'f' => 333, |
'g' => 500, |
'h' => 556, |
'i' => 278, |
'j' => 278, |
'k' => 500, |
'l' => 278, |
'm' => 778, |
'n' => 556, |
'o' => 500, |
'p' => 500, |
'q' => 500, |
'r' => 389, |
's' => 389, |
't' => 278, |
'u' => 556, |
'v' => 444, |
'w' => 667, |
'x' => 500, |
'y' => 444, |
'z' => 389, |
'{' => 348, |
'|' => 220, |
'}' => 348, |
'~' => 570, |
chr(127) => 350, |
chr(128) => 500, |
chr(129) => 350, |
chr(130) => 333, |
chr(131) => 500, |
chr(132) => 500, |
chr(133) => 1000, |
chr(134) => 500, |
chr(135) => 500, |
chr(136) => 333, |
chr(137) => 1000, |
chr(138) => 556, |
chr(139) => 333, |
chr(140) => 944, |
chr(141) => 350, |
chr(142) => 611, |
chr(143) => 350, |
chr(144) => 350, |
chr(145) => 333, |
chr(146) => 333, |
chr(147) => 500, |
chr(148) => 500, |
chr(149) => 350, |
chr(150) => 500, |
chr(151) => 1000, |
chr(152) => 333, |
chr(153) => 1000, |
chr(154) => 389, |
chr(155) => 333, |
chr(156) => 722, |
chr(157) => 350, |
chr(158) => 389, |
chr(159) => 611, |
chr(160) => 250, |
chr(161) => 389, |
chr(162) => 500, |
chr(163) => 500, |
chr(164) => 500, |
chr(165) => 500, |
chr(166) => 220, |
chr(167) => 500, |
chr(168) => 333, |
chr(169) => 747, |
chr(170) => 266, |
chr(171) => 500, |
chr(172) => 606, |
chr(173) => 333, |
chr(174) => 747, |
chr(175) => 333, |
chr(176) => 400, |
chr(177) => 570, |
chr(178) => 300, |
chr(179) => 300, |
chr(180) => 333, |
chr(181) => 576, |
chr(182) => 500, |
chr(183) => 250, |
chr(184) => 333, |
chr(185) => 300, |
chr(186) => 300, |
chr(187) => 500, |
chr(188) => 750, |
chr(189) => 750, |
chr(190) => 750, |
chr(191) => 500, |
chr(192) => 667, |
chr(193) => 667, |
chr(194) => 667, |
chr(195) => 667, |
chr(196) => 667, |
chr(197) => 667, |
chr(198) => 944, |
chr(199) => 667, |
chr(200) => 667, |
chr(201) => 667, |
chr(202) => 667, |
chr(203) => 667, |
chr(204) => 389, |
chr(205) => 389, |
chr(206) => 389, |
chr(207) => 389, |
chr(208) => 722, |
chr(209) => 722, |
chr(210) => 722, |
chr(211) => 722, |
chr(212) => 722, |
chr(213) => 722, |
chr(214) => 722, |
chr(215) => 570, |
chr(216) => 722, |
chr(217) => 722, |
chr(218) => 722, |
chr(219) => 722, |
chr(220) => 722, |
chr(221) => 611, |
chr(222) => 611, |
chr(223) => 500, |
chr(224) => 500, |
chr(225) => 500, |
chr(226) => 500, |
chr(227) => 500, |
chr(228) => 500, |
chr(229) => 500, |
chr(230) => 722, |
chr(231) => 444, |
chr(232) => 444, |
chr(233) => 444, |
chr(234) => 444, |
chr(235) => 444, |
chr(236) => 278, |
chr(237) => 278, |
chr(238) => 278, |
chr(239) => 278, |
chr(240) => 500, |
chr(241) => 556, |
chr(242) => 500, |
chr(243) => 500, |
chr(244) => 500, |
chr(245) => 500, |
chr(246) => 500, |
chr(247) => 570, |
chr(248) => 500, |
chr(249) => 556, |
chr(250) => 556, |
chr(251) => 556, |
chr(252) => 556, |
chr(253) => 444, |
chr(254) => 500, |
chr(255) => 444); |
/tags/v3.1-blanche-neige/jrest/lib/File/PDF/fonts/zapfdingbats.php |
---|
New file |
0,0 → 1,272 |
<?php |
/** |
* @package File_PDF |
*/ |
$font_widths['zapfdingbats'] = array( |
chr(0) => 0, |
chr(1) => 0, |
chr(2) => 0, |
chr(3) => 0, |
chr(4) => 0, |
chr(5) => 0, |
chr(6) => 0, |
chr(7) => 0, |
chr(8) => 0, |
chr(9) => 0, |
chr(10) => 0, |
chr(11) => 0, |
chr(12) => 0, |
chr(13) => 0, |
chr(14) => 0, |
chr(15) => 0, |
chr(16) => 0, |
chr(17) => 0, |
chr(18) => 0, |
chr(19) => 0, |
chr(20) => 0, |
chr(21) => 0, |
chr(22) => 0, |
chr(23) => 0, |
ch |